Currently SciTE command Open Selected Filename
(<dbd>Ctrl</dbd>+<dbd>Shift</dbd>+<dbd>O</dbd>) opens:
But it doesn't open:
This patch allows SciTE to open the paths starting with tilde:
❯ hg status
M src/SciTEIO.cxx
❯ hg diff
diff -r 9e0343bf65b4 src/SciTEIO.cxx
--- a/src/SciTEIO.cxx Tue Nov 21 19:24:16 2023 +1100
+++ b/src/SciTEIO.cxx Thu Nov 23 19:21:56 2023 -0300
@@ -686,6 +686,13 @@
}
}
+ if (StartsWith(selName, "~/")) {
+ selName.erase(0, 2);
+ FilePath selPath(GUI::StringFromUTF8(selName));
+ FilePath expandedPath = FilePath(FilePath::UserHomeDirectory(), selPath);
+ selName = expandedPath.AsInternal();
+ }
+
std::string fileNameForExtension = ExtensionFileName();
std::string openSuffix = props.GetNewExpandString("open.suffix.", fileNameForExtension);
selName += openSuffix;
@@ -1645,4 +1652,3 @@
OutputAppendStringSynchronised(sExitMessage);
}
}
-
Diff:
Committed with small changes (
AsInternal
returns a wide character string on Windows) as [59ce72].Related
Commit: [59ce72]