Skip to content

Commit

Permalink
feat(hl): add new FzfLuaPreviewBorder highlight (closes #778)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikesmithgh authored and ibhagwan committed Jun 11, 2023
1 parent 8d6b638 commit 0a4245f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1144,6 +1144,7 @@ FzfLua conviniently creates the below highlights:
FzfLuaScrollFloatFull = { 'winopts.hl.scrollfloat_f', "PmenuThumb" },
FzfLuaHelpNormal = { 'winopts.hl.help_normal', "FzfLuaNormal" },
FzfLuaHelpBorder = { 'winopts.hl.help_border', "FzfLuaBorder" },
FzfLuaPreviewBorder = { "winopts.hl.preview_border", "Normal" },
```


Expand Down
1 change: 1 addition & 0 deletions lua/fzf-lua/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ function M.setup_highlights()
FzfLuaScrollFloatFull = { "winopts.hl.scrollfloat_f", "PmenuThumb" },
FzfLuaHelpNormal = { "winopts.hl.help_normal", "FzfLuaNormal" },
FzfLuaHelpBorder = { "winopts.hl.help_border", "FzfLuaBorder" },
FzfLuaPreviewBorder = { "winopts.hl.preview_border", "FzfLuaBorder" },
}
for hl_name, v in pairs(highlights) do
-- define a new linked highlight and then override the
Expand Down
4 changes: 2 additions & 2 deletions lua/fzf-lua/win.lua
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ function FzfWin:reset_win_highlights(win, is_border)
if is_border then
-- our border is manually drawn so we need
-- to replace Normal with the border color
hl = ("Normal:%s"):format(self.winopts.__hl.border)
hl = ("Normal:%s"):format(self.winopts.__hl.preview_border)
end
vim.api.nvim_win_set_option(win, "winhighlight", hl)
end
Expand Down Expand Up @@ -851,7 +851,7 @@ function FzfWin:close(fzf_bufnr)
-- When a window is reused, (e.g. open any fzf-lua interface, press <C-\-n> and run
-- ":FzfLua") `FzfWin:set_tmp_buffer()` will call `nvim_buf_delete` on the original
-- fzf terminal buffer which will terminate the fzf process and trigger the call to
-- `fzf_win:close()` within `core.fzf()`. We need to avoid the close in this case.
-- `fzf_win:close()` within `core.fzf()`. We need to avoid the close in this case.
if fzf_bufnr and fzf_bufnr ~= self.fzf_bufnr then
return
end
Expand Down

0 comments on commit 0a4245f

Please sign in to comment.