Skip to content

Commit

Permalink
fix(profiles): do not override title_pos (closes #1690)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibhagwan committed Jan 9, 2025
1 parent c5d53ee commit 122c20c
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 5 deletions.
12 changes: 12 additions & 0 deletions OPTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,18 @@ Type: `boolean`, Default: `false`

Use fullscreen for the fzf-load floating window.

#### globals.winopts.title

Type: `string`, Default: `nil`

Controls title display in the fzf window, set by the calling picker.

#### globals.winopts.title_pos

Type: `string`, Default: `center`

Controls title display in the fzf window, possible values are `left|right|center`.

#### globals.winopts.treesitter

Type: `boolean`, Default: `false`
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ winopts = {
-- Backdrop opacity, 0 is fully opaque, 100 is fully transparent (i.e. disabled)
backdrop = 60,
-- title = "Title",
-- title_pos = "center", -- 'left', 'center' or 'right'
-- title_pos = "center", -- 'left', 'center' or 'right'
fullscreen = false, -- start fullscreen?
-- enable treesitter highlighting for the main fzf window will only have
-- effect where grep like results are present, i.e. "file:line:col:text"
Expand Down
19 changes: 18 additions & 1 deletion doc/fzf-lua-opts.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*fzf-lua-opts.txt* For Neovim >= 0.8.0 Last change: 2025 January 05
*fzf-lua-opts.txt* For Neovim >= 0.8.0 Last change: 2025 January 06

==============================================================================
Table of Contents *fzf-lua-opts-table-of-contents*
Expand Down Expand Up @@ -378,6 +378,23 @@ Use fullscreen for the fzf-load floating window.



globals.winopts.title *fzf-lua-opts-globals.winopts.title*

Type: `string`, Default: `nil`

Controls title display in the fzf window, set by the calling picker.



globals.winopts.title_pos *fzf-lua-opts-globals.winopts.title_pos*

Type: `string`, Default: `center`

Controls title display in the fzf window, possible values are
`left|right|center`.



globals.winopts.treesitter *fzf-lua-opts-globals.winopts.treesitter*

Type: `boolean`, Default: `false`
Expand Down
1 change: 1 addition & 0 deletions lua/fzf-lua/defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ M.defaults = {
zindex = 50,
backdrop = 60,
fullscreen = false,
title_pos = "center",
treesitter = {
enabled = false,
fzf_colors = { ["hl"] = "-1:reverse", ["hl+"] = "-1:reverse" }
Expand Down
5 changes: 2 additions & 3 deletions lua/fzf-lua/profiles/default-title.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ local function title(str, opts)
winopts = {
-- title = { { " " .. str .. " ", "IncSearch" } },
title = " " .. str .. " ",
title_pos = "center",
}
})
end
return {
desc = "defaults using title instead of prompt",
defaults = { prompt = false },
winopts = { title_pos = "center" },
files = title("Files"),
buffers = title("Buffers"),
tabs = title("Tabs"),
Expand Down Expand Up @@ -43,8 +43,7 @@ return {
manpages = title("Man Pages"),
lsp = {
title_prefix = "LSP",
winopts = { title_pos = "center" },
symbols = { title_prefix = "LSP", winopts = { title_pos = "center" } },
symbols = { title_prefix = "LSP" },
finder = title("LSP Finder"),
code_actions = title("Code Actions"),
},
Expand Down

0 comments on commit 122c20c

Please sign in to comment.