Merge pull request #199 from pockata/feat/more-prominent-cur-file

feat: Make current file easily noticeable
This commit is contained in:
ThePrimeagen 2023-02-21 09:28:26 -07:00 committed by GitHub
commit e3e3f7fa6b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -77,6 +77,19 @@ function M.toggle_quick_menu()
return
end
local curr_file = utils.normalize_path(vim.api.nvim_buf_get_name(0))
vim.cmd(
string.format(
"autocmd Filetype harpoon "
.. "let path = '%s' | call clearmatches() | "
-- move the cursor to the line containing the current filename
.. "call search('\\V'.path.'\\$') | "
-- add a hl group to that line
.. "call matchadd('HarpoonCurrentFile', '\\V'.path.'\\$')",
curr_file:gsub("\\", "\\\\")
)
)
local win_info = create_window()
local contents = {}
local global_config = harpoon.get_global_settings()