feat(renderer): add renderer.root_folder_label (#1746)

* Add new renderer setting `add_root_updir` to fix #1743.

* Fix default value in docs.

* Remove proposed “add_root_updir” and rename “root_folder_modifier” to “root_folder_label”. Also, “root_folder_label” can be also a function now.

* chore: warn users about breaking change

* fix(#1743): use silent migration of root_folder_modifier

* fix(#1743): add example, document previous renderer.root_folder_modifier

* Add check to validate return type of “root_folder_label” is string.

* Change “root_folder_label” default value to “:~:s?$?/..?”.

* Add missing keyword “local” to local variable “label”.

Co-authored-by: David Aguilera <david.aguilera@neliosoftware.com>
Co-authored-by: gegoune <dev@clog.rocks>
Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
David Aguilera
2022-11-26 04:02:05 +01:00
committed by GitHub
parent 68a2a0971e
commit 99d713644d
5 changed files with 32 additions and 13 deletions

View File

@@ -499,7 +499,7 @@ local DEFAULT_OPTS = { -- BEGIN_DEFAULT_OPTS
highlight_git = false,
full_name = false,
highlight_opened_files = "none",
root_folder_modifier = ":~",
root_folder_label = ":~:s?$?/..?",
indent_width = 2,
indent_markers = {
enable = false,
@@ -679,6 +679,7 @@ local FIELD_OVERRIDE_TYPECHECK = {
remove_keymaps = { boolean = true, table = true },
on_attach = { ["function"] = true, string = true },
sort_by = { ["function"] = true, string = true },
root_folder_label = { ["function"] = true, string = true },
}
local function validate_options(conf)