From bf8a943f4528f055625bbadef36617b6f1389659 Mon Sep 17 00:00:00 2001 From: Josef Moudrik Date: Wed, 4 Sep 2024 16:34:33 +0200 Subject: [PATCH] fix(windows): check nil (#529) * small fixes: sidebar: opts.win ~= nil case && bash - and bash in Makefile (should correspond to she-bang in build.sh) * fix lua style --- Makefile | 2 +- lua/avante/sidebar.lua | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 87b3c5f..b231f5d 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ else endif else $1: - LUA_VERSION=$1 sh ./build.sh + LUA_VERSION=$1 bash ./build.sh endif endef diff --git a/lua/avante/sidebar.lua b/lua/avante/sidebar.lua index eb6b301..c95cafa 100644 --- a/lua/avante/sidebar.lua +++ b/lua/avante/sidebar.lua @@ -1484,7 +1484,9 @@ function Sidebar:render(opts) opts = opts or {} local chat_history = Path.history.load(self.code.bufnr) - local get_position = function() return (opts and opts.win.position) and opts.win.position or Config.windows.position end + local get_position = function() + return (opts and opts.win and opts.win.position) and opts.win.position or Config.windows.position + end local get_height = function() local selected_code_size = self:get_selected_code_size()