feat(view): Floating nvim tree window #1377 (#1462)

* Simple mock-up of floating nvim-tree window

* Passing whole table to nvim_open_win()

* Run update-help.sh

* Use vim.api alias

* Add comment to float options

* Added `anchor` to float options

* Enabling float window enforces `actions.open_file.quit_on_open`

* Added documentation

* add view.float.open_win_config, skipping validation

* Made nvim-tree window closes when float is enabled

* Close nvim-tree window when out of focus

* Update help

Co-authored-by: Krzysztof Cieśla <krzysztof.marcin.ciesla@cern.ch>
Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
Krzysztof Cieśla
2022-08-06 07:40:07 +02:00
committed by GitHub
parent 1685484738
commit 7323c81bd6
4 changed files with 78 additions and 21 deletions

View File

@@ -187,12 +187,24 @@ Subsequent calls to setup will replace the previous configuration.
number = false,
relativenumber = false,
signcolumn = "yes",
-- @deprecated
mappings = {
custom_only = false,
list = {
-- user mappings go here
},
},
float = {
enable = false,
open_win_config = {
relative = "editor",
border = "rounded",
width = 30,
height = 30,
row = 1,
col = 1,
},
},
},
renderer = {
add_trailing = false,
@@ -639,6 +651,25 @@ Window / buffer setup.
Type: `table`
Default: see |nvim-tree-default-mappings|
*nvim-tree.view.float*
Configuration options for floating window
*nvim-tree.view.float.enable*
Display nvim-tree window as float (enforces |nvim-tree.actions.open_file.quit_on_open| if set).
Type: `boolean`, Default: `false`
*nvim-tree.view.float.open_win_config*
Floating window config. See |nvim_open_win| for more details.
Type: `table`, Default:
`{`
`relative = "editor",`
`border = "rounded",`
`width = 30,`
`height = 30,`
`row = 1,`
`col = 1,`
`}`
*nvim-tree.renderer*
UI rendering setup