feat(view): add view.cursorline (#1859)
* feat(#1814): added cursorline config to DEFAULT_OPTS Extends #1814 Currently, the config cursorline is set to `true` by default. This behaviour can only be changed by a hacky way of listening to an event, as @alex-courtis mentioned that: "The user can change this default if they want via event". This PR generalizes the configuration to be easier to config via the function `setup()`. * doc: add cursorline Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
@@ -191,6 +191,7 @@ Subsequent calls to setup will replace the previous configuration.
|
|||||||
view = {
|
view = {
|
||||||
adaptive_size = false,
|
adaptive_size = false,
|
||||||
centralize_selection = false,
|
centralize_selection = false,
|
||||||
|
cursorline = true,
|
||||||
width = 30,
|
width = 30,
|
||||||
hide_root_folder = false,
|
hide_root_folder = false,
|
||||||
side = "left",
|
side = "left",
|
||||||
@@ -681,6 +682,10 @@ Window / buffer setup.
|
|||||||
initially centralized, see |zz|.
|
initially centralized, see |zz|.
|
||||||
Type: `boolean`, Default: `false`
|
Type: `boolean`, Default: `false`
|
||||||
|
|
||||||
|
*nvim-tree.view.cursorline*
|
||||||
|
Enable |cursorline| in the tree window.
|
||||||
|
Type: `boolean`, Default: `true`
|
||||||
|
|
||||||
*nvim-tree.view.hide_root_folder*
|
*nvim-tree.view.hide_root_folder*
|
||||||
Hide the path of the current working directory on top of the tree.
|
Hide the path of the current working directory on top of the tree.
|
||||||
Type: `boolean`, Default: `false`
|
Type: `boolean`, Default: `false`
|
||||||
|
|||||||
@@ -499,6 +499,7 @@ local DEFAULT_OPTS = { -- BEGIN_DEFAULT_OPTS
|
|||||||
view = {
|
view = {
|
||||||
adaptive_size = false,
|
adaptive_size = false,
|
||||||
centralize_selection = false,
|
centralize_selection = false,
|
||||||
|
cursorline = true,
|
||||||
width = 30,
|
width = 30,
|
||||||
hide_root_folder = false,
|
hide_root_folder = false,
|
||||||
side = "left",
|
side = "left",
|
||||||
|
|||||||
@@ -490,6 +490,7 @@ function M.setup(opts)
|
|||||||
M.View.hide_root_folder = options.hide_root_folder
|
M.View.hide_root_folder = options.hide_root_folder
|
||||||
M.View.tab = opts.tab
|
M.View.tab = opts.tab
|
||||||
M.View.preserve_window_proportions = options.preserve_window_proportions
|
M.View.preserve_window_proportions = options.preserve_window_proportions
|
||||||
|
M.View.winopts.cursorline = options.cursorline
|
||||||
M.View.winopts.number = options.number
|
M.View.winopts.number = options.number
|
||||||
M.View.winopts.relativenumber = options.relativenumber
|
M.View.winopts.relativenumber = options.relativenumber
|
||||||
M.View.winopts.signcolumn = options.signcolumn
|
M.View.winopts.signcolumn = options.signcolumn
|
||||||
|
|||||||
Reference in New Issue
Block a user