Skip to content

Commit f291542

Browse files
committed
feat(mini.nvim): sync to 64a23d0
1 parent b61b126 commit f291542

File tree

4 files changed

+51
-5
lines changed

4 files changed

+51
-5
lines changed

mini.nvim/CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,17 @@ There are following change types:
107107

108108
- Ensure preview window is never hidden, even if cursor is on the line for a not (yet) existing file system entry. This reduces flickering of preview window when creating new files in Insert mode.
109109

110+
### Expand {#v0.17.0-mini.files-expand}
111+
112+
- Add `config.content.highlight` to customize how file system entry is highlighted. Defaults to a new `default_highlight()` function.
113+
110114
## mini.hues {#v0.17.0-mini.hues}
111115

112116
### Evolve {#v0.17.0-mini.hues-evolve}
113117

114-
- Add auto adjusting of highlight groups based on certain events (like `MsgSeparator` group based on changing of `msgsep` flag of 'fillchars' option). It can be disabled via new `autoadjust` config setting or `opts.autoadjust` in `apply_palette()`.
118+
- Add auto adjusting of highlight groups based on certain events. It can be disabled via new `autoadjust` config setting or `opts.autoadjust` in `apply_palette()`. Affected groups:
119+
- `MsgSeparator` depends on `msgsep` flag of 'fillchars' option.
120+
- `Pmenu` depends on 'pumborder' option value (on Neovim>=0.12).
115121

116122
### Refine {#v0.17.0-mini.hues-refine}
117123

mini.nvim/doc/mini-files.qmd

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -740,9 +740,11 @@ Module setup
740740
content = {
741741
-- Predicate for which file system entries to show
742742
filter = nil,
743-
-- What prefix to show to the left of file system entry
743+
-- Highlight group to use for a file system entry
744+
highlight = nil,
745+
-- Prefix text and highlight to show to the left of file system entry
744746
prefix = nil,
745-
-- In which order to show file system entries
747+
-- Order in which to show file system entries
746748
sort = nil,
747749
},
748750

@@ -803,6 +805,10 @@ A file system entry data is a table with the following fields:
803805

804806
- <span class="help-syntax-keys">\<path\></span> `(string)` - full path of an entry.
805807

808+
`content.highlight` describes how file system entry name should be highlighted.
809+
Takes file system entry data as input and returns a highlight group name.
810+
Uses [MiniFiles.default\_highlight()](https://neovim.io/doc/user/helptag.html?tag=MiniFiles.default_highlight\(\)) by default.
811+
806812
`content.prefix` describes what text (prefix) to show to the left of file
807813
system entry name (if any) and how to highlight it. It also takes file
808814
system entry data as input and returns tuple of text and highlight group
@@ -1290,3 +1296,29 @@ put directories first.
12901296

12911297
`(table)` Sorted array of file system entries.
12921298

1299+
---
1300+
1301+
### default_highlight() {#minifiles.default_highlight .help-syntax-right-anchor}
1302+
1303+
<p align="center">`MiniFiles.default_highlight`(<span class="help-syntax-special">{fs_entry}</span>)</p>
1304+
Default file system entry highlight
1305+
1306+
Returns `'MiniFilesDirectory'` for directory and `'MiniFilesFile'` otherwise.
1307+
1308+
#### Parameters {#minifiles.default_highlight-parameters}
1309+
1310+
1311+
1312+
<span class="help-syntax-special">{fs_entry}</span> `(table)` Table with the following fields:
1313+
1314+
- <span class="help-syntax-keys">\<fs_type\></span> `(string)` - one of "file" or "directory".
1315+
1316+
- <span class="help-syntax-keys">\<name\></span> `(string)` - basename of an entry (including extension).
1317+
1318+
- <span class="help-syntax-keys">\<path\></span> `(string)` - full path of an entry.
1319+
1320+
#### Return {#minifiles.default_highlight-return}
1321+
1322+
1323+
`(string)` Highlight group name.
1324+

mini.nvim/doc/mini-hues.qmd

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,12 @@ events relevant to them. Currently adjusted groups:
301301
- [hl-MsgSeparator](https://neovim.io/doc/user/helptag.html?tag=hl-MsgSeparator) is adjusted based on `msgsep` flag in ['fillchars'](https://neovim.io/doc/user/helptag.html?tag='fillchars').
302302
If it is whitespace - highlight background, otherwise - foreground.
303303

304+
305+
- [hl-Pmenu](https://neovim.io/doc/user/helptag.html?tag=hl-Pmenu) is adjusted based on ['pumborder'](https://neovim.io/doc/user/helptag.html?tag='pumborder') value (on Neovim>=0.12).
306+
If it results in a border - same as floating window (but with no accent
307+
foreground in border), otherwise - same as [hl-CursorLine](https://neovim.io/doc/user/helptag.html?tag=hl-CursorLine). This design
308+
makes [ins-completion-menu](https://neovim.io/doc/user/helptag.html?tag=ins-completion-menu) stand out from regular floating windows.
309+
304310
#### Examples {#minihues.config-examples}
305311

306312

mini.nvim/readmes/mini-files.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,11 @@ Here are code snippets for some common installation methods (use only one):
178178
content = {
179179
-- Predicate for which file system entries to show
180180
filter = nil,
181-
-- What prefix to show to the left of file system entry
181+
-- Highlight group to use for a file system entry
182+
highlight = nil,
183+
-- Prefix text and highlight to show to the left of file system entry
182184
prefix = nil,
183-
-- In which order to show file system entries
185+
-- Order in which to show file system entries
184186
sort = nil,
185187
},
186188

0 commit comments

Comments
 (0)