From 436446dd9ad83b35dbcd990b3380f36b737bf05e Mon Sep 17 00:00:00 2001 From: bud Date: Mon, 15 Feb 2021 21:05:06 +0100 Subject: [PATCH 1/5] ADD: in core.step() show full path if view is a document and config.full_path_in_window_title is true --- data/core/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/core/init.lua b/data/core/init.lua index 60a39d8..1fbafc4 100644 --- a/data/core/init.lua +++ b/data/core/init.lua @@ -725,7 +725,7 @@ function core.step() -- update window title local name = core.active_view:get_name() - local title = (name ~= "---") and (name .. " - lite") or "lite" + local title = (name ~= "---") and ( (config.full_path_in_window_title and core.active_view.doc.filename or name) .. " - lite") or "lite" if title ~= core.window_title then system.set_window_title(title) core.window_title = title From 7e3eb4a408377c606668b6a6f920f34263d56397 Mon Sep 17 00:00:00 2001 From: bud Date: Mon, 15 Feb 2021 21:06:03 +0100 Subject: [PATCH 2/5] ADD: default value (false) for full_path_in_window_title --- data/core/config.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/data/core/config.lua b/data/core/config.lua index d6f87bc..c87d48c 100644 --- a/data/core/config.lua +++ b/data/core/config.lua @@ -18,5 +18,6 @@ config.tab_type = "soft" config.line_limit = 80 config.max_symbols = 4000 config.max_project_files = 2000 +config.full_path_in_window_title = false return config From dd30725d84c2d06241b4478e48946c9f41af02e7 Mon Sep 17 00:00:00 2001 From: bud Date: Mon, 15 Feb 2021 22:38:29 +0100 Subject: [PATCH 3/5] FIX: before setting full path to window title, make sure activeView is DocView --- data/core/init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/data/core/init.lua b/data/core/init.lua index 1fbafc4..e8a147b 100644 --- a/data/core/init.lua +++ b/data/core/init.lua @@ -7,6 +7,7 @@ local keymap local RootView local StatusView local CommandView +local DocView local Doc local core = {} @@ -688,6 +689,7 @@ function core.step() local did_keymap = false local mouse_moved = false local mouse = { x = 0, y = 0, dx = 0, dy = 0 } + DocView = require "core.docview" for type, a,b,c,d in system.poll_event do if type == "mousemoved" then @@ -725,7 +727,7 @@ function core.step() -- update window title local name = core.active_view:get_name() - local title = (name ~= "---") and ( (config.full_path_in_window_title and core.active_view.doc.filename or name) .. " - lite") or "lite" + local title = (name ~= "---") and ( (config.full_path_in_window_title and core.active_view:is(DocView) and core.active_view.doc.filename or name) .. " - lite") or "lite" if title ~= core.window_title then system.set_window_title(title) core.window_title = title From 36935569589b244f3c20d84ff6a3776085090789 Mon Sep 17 00:00:00 2001 From: bud Date: Tue, 16 Feb 2021 19:12:56 +0100 Subject: [PATCH 4/5] FIX: get DocView in init instead of step, remove option for window title format' --- data/core/init.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/data/core/init.lua b/data/core/init.lua index e8a147b..d5c57fb 100644 --- a/data/core/init.lua +++ b/data/core/init.lua @@ -330,6 +330,7 @@ function core.init() RootView = require "core.rootview" StatusView = require "core.statusview" CommandView = require "core.commandview" + DocView = require "core.docview" Doc = require "core.doc" do @@ -689,7 +690,7 @@ function core.step() local did_keymap = false local mouse_moved = false local mouse = { x = 0, y = 0, dx = 0, dy = 0 } - DocView = require "core.docview" + for type, a,b,c,d in system.poll_event do if type == "mousemoved" then @@ -727,7 +728,7 @@ function core.step() -- update window title local name = core.active_view:get_name() - local title = (name ~= "---") and ( (config.full_path_in_window_title and core.active_view:is(DocView) and core.active_view.doc.filename or name) .. " - lite") or "lite" + local title = (name ~= "---") and ( (core.active_view:is(DocView) and core.active_view.doc.filename or name) .. " - lite") or "lite" if title ~= core.window_title then system.set_window_title(title) core.window_title = title From 4917be3dafbc5d088e7c43d28f50a7799e707120 Mon Sep 17 00:00:00 2001 From: bud Date: Tue, 16 Feb 2021 19:13:41 +0100 Subject: [PATCH 5/5] remove config for window title format --- data/core/config.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/data/core/config.lua b/data/core/config.lua index c87d48c..d6f87bc 100644 --- a/data/core/config.lua +++ b/data/core/config.lua @@ -18,6 +18,5 @@ config.tab_type = "soft" config.line_limit = 80 config.max_symbols = 4000 config.max_project_files = 2000 -config.full_path_in_window_title = false return config