auto_jump config param
This commit is contained in:
@@ -39,20 +39,6 @@ local function setup_global_autocmd()
|
||||
})
|
||||
end
|
||||
|
||||
local function setup_buffer_autocmd()
|
||||
if config.options.auto_preview then
|
||||
vim.api.nvim_create_autocmd('CursorHold', {
|
||||
buffer = 0,
|
||||
callback = require('symbols-outline.preview').show,
|
||||
})
|
||||
else
|
||||
vim.api.nvim_create_autocmd('CursorMoved', {
|
||||
buffer = 0,
|
||||
callback = require('symbols-outline.preview').close,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
-------------------------
|
||||
-- STATE
|
||||
-------------------------
|
||||
@@ -118,6 +104,25 @@ local function goto_location(change_focus)
|
||||
end
|
||||
end
|
||||
|
||||
local function setup_buffer_autocmd()
|
||||
if config.options.auto_preview then
|
||||
vim.api.nvim_create_autocmd('CursorHold', {
|
||||
buffer = 0,
|
||||
callback = require('symbols-outline.preview').show,
|
||||
})
|
||||
else
|
||||
vim.api.nvim_create_autocmd('CursorMoved', {
|
||||
buffer = 0,
|
||||
callback = function()
|
||||
require('symbols-outline.preview').close()
|
||||
if config.options.auto_jump then
|
||||
goto_location(false)
|
||||
end
|
||||
end,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
function M._set_folded(folded, move_cursor, node_index)
|
||||
local node = M.state.flattened_outline_items[node_index] or M._current_node()
|
||||
local changed = (folded ~= folding.is_folded(node))
|
||||
|
||||
@@ -10,6 +10,7 @@ M.defaults = {
|
||||
relative_width = true,
|
||||
width = 25,
|
||||
auto_close = false,
|
||||
auto_jump = false,
|
||||
auto_preview = false,
|
||||
show_numbers = false,
|
||||
show_relative_numbers = false,
|
||||
|
||||
Reference in New Issue
Block a user