chore(fmt): stylua
This commit is contained in:
@@ -147,9 +147,9 @@ end
|
|||||||
function Preview:close()
|
function Preview:close()
|
||||||
-- TODO: Why was this in symbols-outline.nvim?
|
-- TODO: Why was this in symbols-outline.nvim?
|
||||||
-- if self.s:has_code_win() then
|
-- if self.s:has_code_win() then
|
||||||
if self.win ~= nil and vim.api.nvim_win_is_valid(self.win) then
|
if self.win ~= nil and vim.api.nvim_win_is_valid(self.win) then
|
||||||
vim.api.nvim_win_close(self.win, true)
|
vim.api.nvim_win_close(self.win, true)
|
||||||
end
|
end
|
||||||
-- end
|
-- end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -118,7 +118,8 @@ function M.rename_symbol(sidebar)
|
|||||||
bufnr = sidebar.code.buf,
|
bufnr = sidebar.code.buf,
|
||||||
newName = new_name,
|
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
|
if status == nil or status.err or err or status.result == nil then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
local View = require('outline.view')
|
|
||||||
local Preview = require('outline.preview')
|
local Preview = require('outline.preview')
|
||||||
|
local View = require('outline.view')
|
||||||
local cfg = require('outline.config')
|
local cfg = require('outline.config')
|
||||||
local folding = require('outline.folding')
|
local folding = require('outline.folding')
|
||||||
local parser = require('outline.parser')
|
local parser = require('outline.parser')
|
||||||
@@ -168,12 +168,16 @@ function Sidebar:setup_buffer_autocmd()
|
|||||||
if cfg.o.preview_window.auto_preview then
|
if cfg.o.preview_window.auto_preview then
|
||||||
vim.api.nvim_create_autocmd('CursorMoved', {
|
vim.api.nvim_create_autocmd('CursorMoved', {
|
||||||
buffer = 0,
|
buffer = 0,
|
||||||
callback = function() self.preview:show() end,
|
callback = function()
|
||||||
|
self.preview:show()
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
else
|
else
|
||||||
vim.api.nvim_create_autocmd('CursorMoved', {
|
vim.api.nvim_create_autocmd('CursorMoved', {
|
||||||
buffer = 0,
|
buffer = 0,
|
||||||
callback = function() self.preview:close() end,
|
callback = function()
|
||||||
|
self.preview:close()
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
if cfg.o.outline_window.auto_jump then
|
if cfg.o.outline_window.auto_jump then
|
||||||
@@ -471,7 +475,12 @@ function Sidebar:_set_all_folded(folded, nodes)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function Sidebar:has_code_win()
|
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
|
end
|
||||||
|
|
||||||
---@see outline.follow_cursor
|
---@see outline.follow_cursor
|
||||||
|
|||||||
Reference in New Issue
Block a user