From bbc3ea41043a6f365c875c2d9fa04c0ec0b19f68 Mon Sep 17 00:00:00 2001 From: Francesco Abbate Date: Sat, 22 May 2021 18:02:58 +0200 Subject: [PATCH 1/7] Update copyright and version info info.plist --- dev-utils/Info.plist | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev-utils/Info.plist b/dev-utils/Info.plist index 75591560..014e0e36 100644 --- a/dev-utils/Info.plist +++ b/dev-utils/Info.plist @@ -16,8 +16,8 @@ MinimumOSVersion10.13 CFBundleShortVersionString - 1.16.5 + 1.16.10 NSHumanReadableCopyright - © 2019-2021 rxi franko + © 2019-2021 Francesco Abbate From df3e1157d07d6762cf8cf72b743a05a87faf0155 Mon Sep 17 00:00:00 2001 From: Francesco Abbate Date: Sat, 22 May 2021 18:03:30 +0200 Subject: [PATCH 2/7] Add NSDocumentsFolderUsageDescription in info.plist Related to issue #203. Add also NSDesktopFolderUsageDescription. --- dev-utils/Info.plist | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dev-utils/Info.plist b/dev-utils/Info.plist index 014e0e36..8f3e38f0 100644 --- a/dev-utils/Info.plist +++ b/dev-utils/Info.plist @@ -15,6 +15,8 @@ NSHighResolutionCapable MinimumOSVersion10.13 + NSDocumentsFolderUsageDescriptionapplication index whole project folders + NSDesktopFolderUsageDescriptionapplication index whole project folders CFBundleShortVersionString 1.16.10 NSHumanReadableCopyright From 81e8c8a22348d9ff944817c1e25553af6c6279d6 Mon Sep 17 00:00:00 2001 From: Francesco Abbate Date: Sat, 22 May 2021 23:31:49 +0200 Subject: [PATCH 3/7] Fix typo --- changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 1a273ce9..19e0522e 100644 --- a/changelog.md +++ b/changelog.md @@ -17,7 +17,7 @@ Under very specific situations the application was crashing due to invalid memor Add documentation for keymap binding, thanks to @Janis-Leuenberger. -Added a contibutors page in `doc/contributors.md`. +Added a contributors page in `doc/contributors.md`. ### 1.16.9 From 739763675eb325732505eed9990c41a2551ca35b Mon Sep 17 00:00:00 2001 From: Francesco Abbate Date: Sat, 22 May 2021 23:32:45 +0200 Subject: [PATCH 4/7] Check the real absolute path of user module Close issue #212 --- data/core/init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/core/init.lua b/data/core/init.lua index e2da7806..fcadea24 100644 --- a/data/core/init.lua +++ b/data/core/init.lua @@ -1011,7 +1011,8 @@ end core.add_save_hook(function(filename) local doc = core.active_view.doc - if doc and doc:is(Doc) and doc.abs_filename == USERDIR .. PATHSEP .. "init.lua" then + local user_filename = system.absolute_path(USERDIR .. PATHSEP .. "init.lua") + if doc and doc:is(Doc) and doc.abs_filename == user_filename then core.reload_module("core.style") core.load_user_directory() end From 3634c212a9b2222ff50746b2e2b9fe689681feec Mon Sep 17 00:00:00 2001 From: Francesco Date: Sun, 23 May 2021 15:23:04 +0200 Subject: [PATCH 5/7] Add macos access request for Downloads folder Close #203 --- dev-utils/Info.plist | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dev-utils/Info.plist b/dev-utils/Info.plist index 8f3e38f0..cc369cd0 100644 --- a/dev-utils/Info.plist +++ b/dev-utils/Info.plist @@ -15,8 +15,9 @@ NSHighResolutionCapable MinimumOSVersion10.13 - NSDocumentsFolderUsageDescriptionapplication index whole project folders - NSDesktopFolderUsageDescriptionapplication index whole project folders + NSDocumentsFolderUsageDescriptionTo access, edit and index your projects. + NSDesktopFolderUsageDescriptionTo access, edit and index your projects. + NSDownloadsFolderUsageDescriptionTo access, edit and index your projects. CFBundleShortVersionString 1.16.10 NSHumanReadableCopyright From f17f5a4d6d9cfd45309d1a9214c01753e93a4b60 Mon Sep 17 00:00:00 2001 From: Francesco Abbate Date: Mon, 24 May 2021 15:57:02 +0200 Subject: [PATCH 6/7] Fix problem with filenames missing normalization --- data/core/commands/core.lua | 11 ++++++++--- data/core/common.lua | 4 +++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/data/core/commands/core.lua b/data/core/commands/core.lua index abbe7cb4..9b348262 100644 --- a/data/core/commands/core.lua +++ b/data/core/commands/core.lua @@ -89,17 +89,22 @@ command.add(nil, { local view = core.active_view if view.doc and view.doc.abs_filename then local dirname, filename = view.doc.abs_filename:match("(.*)[/\\](.+)$") - core.command_view:set_text(core.normalize_to_project_dir(dirname) .. PATHSEP) + if dirname then + dirname = core.normalize_to_project_dir(dirname) + local text = dirname == core.project_dir and "" or common.home_encode(dirname) .. PATHSEP + core.command_view:set_text(text) + end end core.command_view:enter("Open File", function(text) - core.root_view:open_doc(core.open_doc(common.home_expand(text))) + local filename = system.absolute_path(common.home_expand(text)) + core.root_view:open_doc(core.open_doc(filename)) end, function (text) return common.home_encode_list(common.path_suggest(common.home_expand(text))) end, nil, function(text) local path_stat, err = system.get_file_info(common.home_expand(text)) if err then core.error("Cannot open file %q: %q", text, err) - elseif path_stat.type == 'dir' then + elseif path_stat.type == 'dir' then core.error("Cannot open %q, is a folder", text) else return true diff --git a/data/core/common.lua b/data/core/common.lua index 05f91111..e8a989df 100644 --- a/data/core/common.lua +++ b/data/core/common.lua @@ -206,7 +206,9 @@ end function common.home_encode(text) if HOME and string.find(text, HOME, 1, true) == 1 then local dir_pos = #HOME + 1 - if string.find(text, PATHSEP, dir_pos, true) == dir_pos then + -- ensure we don't replace if the text is just "$HOME" or "$HOME/" so + -- it must have a "/" following the $HOME and some characters following. + if string.find(text, PATHSEP, dir_pos, true) == dir_pos and #text > dir_pos then return "~" .. text:sub(dir_pos) end end From 8acb3fae8c9bdcd1187f9b372f22bda74f67f4f3 Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Mon, 24 May 2021 17:26:16 -0400 Subject: [PATCH 7/7] Fixed minor error that occurs when saving as after viewing a non-doc tab. --- data/core/commands/doc.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/core/commands/doc.lua b/data/core/commands/doc.lua index 6acc4e8b..938f9c59 100644 --- a/data/core/commands/doc.lua +++ b/data/core/commands/doc.lua @@ -343,7 +343,7 @@ local commands = { ["doc:save-as"] = function() if doc().filename then core.command_view:set_text(doc().filename) - elseif core.last_active_view then + elseif core.last_active_view and core.last_active_view.doc then local dirname, filename = core.last_active_view.doc.abs_filename:match("(.*)[/\\](.+)$") core.command_view:set_text(core.normalize_to_project_dir(dirname) .. PATHSEP) end