diff --git a/lua/outline/preview.lua b/lua/outline/preview.lua index 2054e2e..3d2ddca 100644 --- a/lua/outline/preview.lua +++ b/lua/outline/preview.lua @@ -147,9 +147,9 @@ end function Preview:close() -- TODO: Why was this in symbols-outline.nvim? -- if self.s:has_code_win() then - if self.win ~= nil and vim.api.nvim_win_is_valid(self.win) then - vim.api.nvim_win_close(self.win, true) - end + if self.win ~= nil and vim.api.nvim_win_is_valid(self.win) then + vim.api.nvim_win_close(self.win, true) + end -- end end diff --git a/lua/outline/providers/nvim-lsp.lua b/lua/outline/providers/nvim-lsp.lua index 5b482d9..fadb4e8 100644 --- a/lua/outline/providers/nvim-lsp.lua +++ b/lua/outline/providers/nvim-lsp.lua @@ -118,7 +118,8 @@ function M.rename_symbol(sidebar) bufnr = sidebar.code.buf, newName = new_name, } - local status, err = client.request_sync('textDocument/rename', params, request_timeout, sidebar.code.buf) + local status, err = + client.request_sync('textDocument/rename', params, request_timeout, sidebar.code.buf) if status == nil or status.err or err or status.result == nil then return false end diff --git a/lua/outline/sidebar.lua b/lua/outline/sidebar.lua index fb4bd05..ff1530b 100644 --- a/lua/outline/sidebar.lua +++ b/lua/outline/sidebar.lua @@ -1,5 +1,5 @@ -local View = require('outline.view') local Preview = require('outline.preview') +local View = require('outline.view') local cfg = require('outline.config') local folding = require('outline.folding') local parser = require('outline.parser') @@ -168,12 +168,16 @@ function Sidebar:setup_buffer_autocmd() if cfg.o.preview_window.auto_preview then vim.api.nvim_create_autocmd('CursorMoved', { buffer = 0, - callback = function() self.preview:show() end, + callback = function() + self.preview:show() + end, }) else vim.api.nvim_create_autocmd('CursorMoved', { buffer = 0, - callback = function() self.preview:close() end, + callback = function() + self.preview:close() + end, }) end if cfg.o.outline_window.auto_jump then @@ -471,7 +475,12 @@ function Sidebar:_set_all_folded(folded, nodes) end function Sidebar:has_code_win() - return self.code.win and self.code.buf and self.code.win ~= 0 and self.code.buf ~= 0 and vim.api.nvim_win_is_valid(self.code.win) and vim.api.nvim_buf_is_valid(self.code.buf) + return self.code.win + and self.code.buf + and self.code.win ~= 0 + and self.code.buf ~= 0 + and vim.api.nvim_win_is_valid(self.code.win) + and vim.api.nvim_buf_is_valid(self.code.buf) end ---@see outline.follow_cursor