Merge pull request #59 from ram02z/patch-1

Clean up
This commit is contained in:
sim
2021-08-22 16:29:54 -07:00
committed by GitHub
6 changed files with 7 additions and 20 deletions

View File

@@ -109,7 +109,7 @@ vim.g.symbols_outline = {
| Enter | Go to symbol location in code |
| o | Go to symbol location in code without losing focus |
| Ctrl+Space | Hover current symbol |
| K | Toggles the current symbol preview (Only when auto_preview is off) |
| K | Toggles the current symbol preview |
| r | Rename symbol |
| a | Code actions |
| ? | Show help message |

View File

@@ -233,7 +233,7 @@ symbol_blacklist
| Enter | Go to symbol location in code |
| o | Go to symbol location in code without losing focus |
| Ctrl+Space | Hover current symbol |
| K | Toggles the current symbol preview (Only when auto_preview is off) |
| K | Toggles the current symbol preview |
| r | Rename symbol |
| a | Code actions |
| ? | Show help message |

View File

@@ -1,9 +0,0 @@
symbols-outline-commands symbols-outline.txt /*symbols-outline-commands*
symbols-outline-configuration symbols-outline.txt /*symbols-outline-configuration*
symbols-outline-contents symbols-outline.txt /*symbols-outline-contents*
symbols-outline-default_keymaps symbols-outline.txt /*symbols-outline-default_keymaps*
symbols-outline-highlights symbols-outline.txt /*symbols-outline-highlights*
symbols-outline-installation symbols-outline.txt /*symbols-outline-installation*
symbols-outline-introduction symbols-outline.txt /*symbols-outline-introduction*
symbols-outline-prerequisites symbols-outline.txt /*symbols-outline-prerequisites*
symbols-outline.txt symbols-outline.txt /*symbols-outline.txt*

View File

@@ -32,7 +32,7 @@ end
local function setup_buffer_autocmd()
if config.options.auto_preview then
vim.cmd(
"au CursorHold <buffer> lua require'symbols-outline.preview'.show(true)")
"au CursorHold <buffer> lua require'symbols-outline.preview'.show()")
else
vim.cmd(
"au CursorMoved <buffer> lua require'symbols-outline.preview'.close()")

View File

@@ -186,16 +186,12 @@ local function show_hover()
end
end
function M.show(force)
function M.show()
if not is_current_win_outline() or
#vim.api.nvim_list_wins() < 2 then
return
end
if force ~= true and state.preview_win ~= nil then
return 1
end
show_preview()
show_hover()
end
@@ -214,9 +210,10 @@ function M.close()
end
function M.toggle()
local code = M.show()
if code == 1 then
if state.preview_win ~= nil then
M.close()
else
M.show()
end
end

View File

@@ -40,7 +40,6 @@ function M.setup_highlights()
local comment_fg_gui = vim.fn.synIDattr(vim.fn.synIDtrans(vim.fn.hlID('Comment')), 'fg', 'gui')
local comment_fg_cterm = vim.fn.synIDattr(vim.fn.synIDtrans(vim.fn.hlID('Comment')), 'fg',
'cterm')
print(comment_fg_gui)
if vim.fn.hlexists('SymbolsOutlineConnector') == 0 then
vim.cmd(string.format('hi SymbolsOutlineConnector ctermfg=%s guifg=%s',