Skip to content

Commit d194823

Browse files
committed
fix(misc): various test fixes and enhancing the entry preview.
1 parent 2a53d9e commit d194823

31 files changed

Lines changed: 302 additions & 132 deletions

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- [Primary stage](#primary-stage)
1111
- [Matching stage](#matching-stage)
1212
- [Features](#features)
13+
- [PICKERS](#pickers)
1314
- [Description](#description)
1415
- [Installation](#installation)
1516
- [Using packer.nvim](#using-packernvimhttpsgithubcomwbthomasonpackernvim)
@@ -30,20 +31,21 @@
3031
- [Dynamic streams](#dynamic-streams)
3132
- [Contextual awareness](#contextual-awareness)
3233
- [Interaction](#interaction)
33-
- [Interactive and Fuzzy stages](#interactive-and-fuzzy-stages)
34-
- [Closing and hiding pickers](#closing-and-hiding-pickers)
34+
- [Interactive & Matching stages](#interactive--matching-stages)
35+
- [Closing & hiding pickers](#closing--hiding-pickers)
3536
- [Dynamic context evaluation](#dynamic-context-evaluation)
36-
- [Picker actions & interaction](#picker-actions--interaction)
37+
- [Actions & interaction](#actions--interaction)
3738
- [Picker Options](#picker-options)
3839
- [Core options](#core-options)
3940
- [Advanced options](#advanced-options)
4041
- [Option details](#option-details)
4142
- [Core options](#core-options-1)
4243
- [Advanced options](#advanced-options-1)
43-
- [In-depth look](#in-depth-look)
44+
- [In-depth description](#in-depth-description)
4445
- [Actions](#actions)
4546
- [Previewers](#previewers)
4647
- [Decorators](#decorators)
48+
- [Highlighters](#highlighters)
4749
- [Converters](#converters)
4850
- [Examples](#examples)
4951
- [Interactive grep](#interactive-grep)

lua/fuzzy/init.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,14 @@ function M.setup(opts)
5050
vim.api.nvim_set_hl(0, "SelectHeaderDefault", { link = "Normal", default = false })
5151
vim.api.nvim_set_hl(0, "SelectHeaderPadding", { link = "NonText", default = false })
5252
vim.api.nvim_set_hl(0, "SelectHeaderDelimiter", { link = "Ignore", default = false })
53-
vim.api.nvim_set_hl(0, "SelectDecoratorDefault", { link = "Normal", default = false })
54-
vim.api.nvim_set_hl(0, "SelectLineHighlight", { link = "Visual", default = false })
5553

5654
vim.api.nvim_set_hl(0, "PickerHeaderActionKey", { link = "ErrorMsg", default = false })
5755
vim.api.nvim_set_hl(0, "PickerHeaderActionLabel", { link = "MoreMsg", default = false })
5856
vim.api.nvim_set_hl(0, "PickerHeaderActionSeparator", { link = "ModeMsg", default = false })
5957

58+
vim.api.nvim_set_hl(0, "SelectLineHighlight", { link = "Normal", default = false })
59+
vim.api.nvim_set_hl(0, "SelectDecoratorDefault", { link = "Normal", default = false })
60+
6061
Pool.prime(pool_config.prime_sizes or {})
6162
end
6263

lua/fuzzy/picker.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,8 +907,8 @@ function Picker.new(opts)
907907
context = {
908908
args = {},
909909
env = nil,
910+
cwd = nil,
910911
tick = nil,
911-
cwd = vim.loop.cwd,
912912
},
913913
interactive = false,
914914
stream_map = nil,

lua/fuzzy/pickers/btags.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function M.open_btags_picker(opts)
4646
},
4747
highlighters = {
4848
Select.RegexHighlighter.new({
49-
{ "^%S+", "Identifier" },
49+
{ "^%S+", "Function" },
5050
{ "%s%[([^%]]+)%]$", "Type", 1 },
5151
}),
5252
},

lua/fuzzy/pickers/buffers.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,8 @@ function M.open_buffers_picker(opts)
241241
highlighters = {
242242
Select.RegexHighlighter.new({
243243
{ "^%d+", "Number" },
244-
{ "%s.+$", "Directory" },
244+
{ "^%d+%s+(.*/)", "Directory", 1 },
245+
{ "([^/]+)$", "Function", 1 },
245246
}),
246247
},
247248
display = function(entry)

lua/fuzzy/pickers/changes.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ function M.open_changes_picker(opts)
7171
preview = opts.preview,
7272
actions = util.build_default_actions(conv, opts),
7373
decorators = decorators,
74+
highlighters = {
75+
Select.RegexHighlighter.new({
76+
{ "%d+:%d+", "Number" },
77+
}),
78+
},
7479
display = function(entry)
7580
return util.format_location_entry(
7681
nil, entry.lnum or 1, entry.col or 1

lua/fuzzy/pickers/colorscheme.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ function M.open_colorscheme_picker(opts)
7474
},
7575
preview = opts.preview,
7676
actions = actions,
77+
highlighters = {
78+
Select.RegexHighlighter.new({
79+
{ "^.+$", "Constant" },
80+
}),
81+
},
7782
}, opts, {
7883
match_timer = 5,
7984
match_step = 1000,

lua/fuzzy/pickers/command_history.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ function M.open_command_history(opts)
3636
return false
3737
end)),
3838
},
39+
highlighters = {
40+
Select.RegexHighlighter.new({
41+
{ "^%S+", "Statement" },
42+
{ "%s(.+)$", "Comment", 1 },
43+
}),
44+
},
3945
}, opts, {
4046
match_timer = 5,
4147
match_step = 1000,

lua/fuzzy/pickers/commands.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ function M.open_commands_picker(opts)
7272
return false
7373
end)),
7474
},
75+
highlighters = {
76+
Select.RegexHighlighter.new({
77+
{ "^%S+", "Statement" },
78+
}),
79+
},
7580
}, opts, {
7681
match_timer = 5,
7782
match_step = 2000,

lua/fuzzy/pickers/files.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,12 @@ function M.open_files_picker(opts)
122122
preview = opts.preview,
123123
actions = util.build_default_actions(conv, opts),
124124
decorators = decorators,
125+
highlighters = {
126+
Select.RegexHighlighter.new({
127+
{ "^.+/", "Directory" },
128+
{ "[^/]+$", "Identifier" },
129+
}),
130+
},
125131
}, opts, {
126132
match_timer = 30,
127133
match_step = 75000,

0 commit comments

Comments
 (0)