TreeView Changes (#898)

* Change to 1 click as per RFC on discord, with 100% in favour.

* Added in the ability to specify  as a view name, so it doesn't modify the title, and also fixed a bug where if you clicked *over* the amount of times your config says, it wouldn't regsiter.

* Changed plugin to use keymap.
This commit is contained in:
Adam
2022-05-09 21:33:22 -04:00
committed by Adam Harrison
parent ddc3a8842b
commit f1f8a9b3f2
2 changed files with 21 additions and 48 deletions
+4 -3
View File
@@ -1170,12 +1170,13 @@ end
local function get_title_filename(view)
local doc_filename = view.get_filename and view:get_filename() or view:get_name()
return (doc_filename ~= "---") and doc_filename or ""
if doc_filename ~= "---" then return doc_filename end
return ""
end
function core.compose_window_title(title)
return title == "" and "Lite XL" or title .. " - Lite XL"
return (title == "" or title == nil) and "Lite XL" or title .. " - Lite XL"
end
@@ -1214,7 +1215,7 @@ function core.step()
-- update window title
local current_title = get_title_filename(core.active_view)
if current_title ~= core.window_title then
if current_title ~= nil and current_title ~= core.window_title then
system.set_window_title(core.compose_window_title(current_title))
core.window_title = current_title
end