Skip to content

Commit f1c65ed

Browse files
committed
feat(fzf): use --info=inline-right if ver >= 0.42
1 parent 4555533 commit f1c65ed

File tree

3 files changed

+13
-18
lines changed

3 files changed

+13
-18
lines changed

README.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ require'fzf-lua'.setup {
665665
-- set to `true` for a no-value flag
666666
-- for raw args use `fzf_args` instead
667667
["--ansi"] = true,
668-
["--info"] = "inline",
668+
["--info"] = "inline-right", -- fzf < v0.42 = "inline"
669669
["--height"] = "100%",
670670
["--layout"] = "reverse",
671671
["--border"] = "none",
@@ -1083,7 +1083,7 @@ require'fzf-lua'.setup {
10831083
-- 'tags_live_grep' options, `rg` prioritizes over `grep`
10841084
rg_opts = "--no-heading --color=always --smart-case",
10851085
grep_opts = "--color=auto --perl-regexp",
1086-
fzf_opts = { ["--info"] = "default", ["--tiebreak"] = "begin" },
1086+
fzf_opts = { ["--tiebreak"] = "begin" },
10871087
actions = {
10881088
-- actions inherit from 'actions.files' and merge
10891089
-- this action toggles between 'grep' and 'live_grep'
@@ -1101,7 +1101,7 @@ require'fzf-lua'.setup {
11011101
git_icons = false,
11021102
rg_opts = "--color=never --no-heading",
11031103
grep_opts = "--color=never --perl-regexp",
1104-
fzf_opts = { ["--info"] = "default", ["--tiebreak"] = "begin" },
1104+
fzf_opts = { ["--tiebreak"] = "begin" },
11051105
-- actions inherit from 'actions.files'
11061106
},
11071107
colorschemes = {
@@ -1122,7 +1122,6 @@ require'fzf-lua'.setup {
11221122
max_threads = 5, -- max download/update threads
11231123
winopts = { row = 0, col = 0.99, width = 0.50 },
11241124
fzf_opts = {
1125-
["--info"] = "default",
11261125
["--multi"] = true,
11271126
["--delimiter"] = "[:]",
11281127
["--with-nth"] = "3..",
@@ -1217,10 +1216,7 @@ require'fzf-lua'.setup {
12171216
symbol_fmt = function(s, opts) return "[" .. s .. "]" end,
12181217
-- prefix child symbols. set to any string or `false` to disable
12191218
child_prefix = true,
1220-
fzf_opts = {
1221-
["--tiebreak"] = "begin",
1222-
["--info"] = "default",
1223-
},
1219+
fzf_opts = { ["--tiebreak"] = "begin" },
12241220
},
12251221
code_actions = {
12261222
prompt = 'Code Actions> ',
@@ -1232,7 +1228,6 @@ require'fzf-lua'.setup {
12321228
},
12331229
finder = {
12341230
prompt = "LSP Finder> ",
1235-
fzf_opts = { ["--info"] = "default" },
12361231
file_icons = true,
12371232
color_icons = true,
12381233
git_icons = false,

lua/fzf-lua/core.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,11 +549,16 @@ M.build_fzf_cli = function(opts)
549549
opts.fzf_opts["--preview-window"] =
550550
opts.fzf_opts["--preview-window"] .. ":" .. opts.preview_offset
551551
end
552+
if opts.__FZF_VERSION and opts.__FZF_VERSION < 0.42 then
553+
if opts.fzf_opts["--info"]:match("^inline%-right") then
554+
opts.fzf_opts["--info"] = "inline"
555+
end
556+
end
552557
if opts._is_skim then
553558
-- skim (rust version of fzf) doesn't support the '--info=' flag
554559
local info = opts.fzf_opts["--info"]
555560
opts.fzf_opts["--info"] = nil
556-
if info == "inline" then
561+
if info:match("^inline") then
557562
-- inline for skim is defined as:
558563
opts.fzf_opts["--inline-info"] = true
559564
end

lua/fzf-lua/defaults.lua

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ M.defaults = {
113113
fzf_bin = nil,
114114
fzf_opts = {
115115
["--ansi"] = true,
116-
["--info"] = "inline",
116+
["--info"] = "inline-right",
117117
["--height"] = "100%",
118118
["--layout"] = "reverse",
119119
["--border"] = "none",
@@ -203,7 +203,7 @@ M.defaults.files = {
203203
cwd_prompt = true,
204204
cwd_prompt_shorten_len = 32,
205205
cwd_prompt_shorten_val = 1,
206-
fzf_opts = { ["--info"] = "default", ["--multi"] = true },
206+
fzf_opts = { ["--multi"] = true },
207207
_fzf_nth_devicons = true,
208208
git_status_cmd = {
209209
"git", "-c", "color.status=false", "--no-optional-locks", "status", "--porcelain=v1" },
@@ -342,7 +342,7 @@ M.defaults.grep = {
342342
file_icons = true and M._has_devicons,
343343
color_icons = true,
344344
git_icons = true,
345-
fzf_opts = { ["--info"] = "default", ["--multi"] = true },
345+
fzf_opts = { ["--multi"] = true },
346346
grep_opts = utils.is_darwin()
347347
and "--binary-files=without-match --line-number --recursive --color=always "
348348
.. "--extended-regexp -e"
@@ -523,7 +523,6 @@ M.defaults.tags = {
523523
["--no-multi"] = true,
524524
["--delimiter"] = string.format("[:%s]", utils.nbsp),
525525
["--tiebreak"] = "begin",
526-
["--info"] = "default",
527526
},
528527
_actions = function() return M.globals.actions.files end,
529528
actions = { ["ctrl-g"] = { actions.grep_lgrep } },
@@ -545,7 +544,6 @@ M.defaults.btags = {
545544
["--delimiter"] = string.format("[:%s]", utils.nbsp),
546545
["--with-nth"] = "1,-1",
547546
["--tiebreak"] = "begin",
548-
["--info"] = "default",
549547
},
550548
_actions = function() return M.globals.actions.files end,
551549
actions = { ["ctrl-g"] = false },
@@ -571,7 +569,6 @@ M.defaults.awesome_colorschemes = {
571569
live_preview = true,
572570
max_threads = 5,
573571
fzf_opts = {
574-
["--info"] = "default",
575572
["--multi"] = true,
576573
["--delimiter"] = "[:]",
577574
["--with-nth"] = "3..",
@@ -678,7 +675,6 @@ M.defaults.lsp.symbols = {
678675
fzf_opts = {
679676
["--delimiter"] = string.format("[:%s]", utils.nbsp),
680677
["--tiebreak"] = "begin",
681-
["--info"] = "default",
682678
["--no-multi"] = true,
683679
},
684680
line_field_index = "{-2}", -- line field index
@@ -707,7 +703,6 @@ M.defaults.lsp.symbols = {
707703
M.defaults.lsp.finder = {
708704
previewer = M._default_previewer_fn,
709705
prompt = "LSP Finder> ",
710-
fzf_opts = { ["--info"] = "default" },
711706
file_icons = true and M._has_devicons,
712707
color_icons = true,
713708
git_icons = false,

0 commit comments

Comments
 (0)