Skip to content

Commit 023bab6

Browse files
committed
feat: closes #91, set filetype of popup windows
1 parent e536a62 commit 023bab6

File tree

3 files changed

+36
-3
lines changed

3 files changed

+36
-3
lines changed

doc/neo-tree.txt

+33-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ Mappings ............ |Neo-tree-Mappings|
1010
Filter ............ |Neo-tree-Filter|
1111
Configuration ....... |Neo-tree-Configuration|
1212
Setup ............. |Neo-tree-Setup|
13+
Buffer Variables .. |Neo-tree-buffer-variables|
14+
Popups ............ |Neo-tree-Popups|
15+
1316
Diagnostics ....... |Neo-tree-Diagnostics|
1417
Highlights ........ |Neo-tree-Highlights|
1518
Events ............ |Neo-tree-Events|
@@ -334,7 +337,36 @@ require("neo-tree").setup({
334337
})
335338
<
336339

337-
GIT STATUS *Neo-tree_Setup-Git-Status*
340+
341+
BUFFER VARIABLES *Neo-tree-buffer-variables*
342+
343+
Neo-tree sets certain buffer options and variables that you may use in custom
344+
code or integrations if you need it. The |filetype| of the main window is
345+
`neo-tree`. The buffer will also have these local variables set:
346+
347+
`winid` The window handle of the window that it was created in.
348+
`tabnr` The tab number that it was created in.
349+
`source` The name of the source that created it, i.e. filesystem, buffers, etc.
350+
351+
Please note that if the buffer is displayed in another window or tab, it's
352+
behavior is unpredictable. It is meant to be locked to it's original location,
353+
which is why those variables are recorded.
354+
355+
356+
POPUPS *Neo-tree-Popups*
357+
358+
Popups will be created with a |filetype| of `neo-tree-popup`. You can use this
359+
as the target for autocmds or to exclude them from being acted upon by other
360+
plugins.
361+
362+
They can also be configured by setting the `popup_border_style` in your config,
363+
and the colors of that border are controlled by the `NeoTreeFloatBorder`
364+
highlight group. If you you use the special `NC` option for
365+
`popup_border_style`, the title bar of that popup uses the `NeoTreeTitleBar`
366+
highlight group.
367+
368+
369+
GIT STATUS *Neo-tree-Setup-Git-Status*
338370

339371
By default, Neo-tree will attempt to get the git status for files in the
340372
current directory. It will use this information to add markers to the right of

lua/neo-tree/sources/filesystem/init.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ end
2222

2323
-- TODO: DEPRECATED in 1.19, remove in 2.0
2424
-- Leaving this here for now because it was mentioned in the help file.
25-
M.reveal_current_file = function(toggle_if_open)
25+
M.reveal_current_file = function()
2626
log.warn("DEPRECATED: use `neotree.sources.manager.reveal_current_file('filesystem')` instead")
27-
return manager.reveal_current_file(M.name, toggle_if_open)
27+
return manager.reveal_current_file(M.name)
2828
end
2929

3030
M.follow = function(callback, force_show)

lua/neo-tree/ui/popups.lua

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ M.popup_options = function(title, min_width, override_options)
3838
buf_options = {
3939
bufhidden = "delete",
4040
buflisted = false,
41+
filetype = "neo-tree-popup",
4142
},
4243
}
4344

0 commit comments

Comments
 (0)