aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/qregisters.cpp
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2015-06-12 15:12:59 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2015-06-12 15:12:59 +0200
commit7919aca84cdea7746b60fec9795e9617c266dd1d (patch)
tree90db8c7d899b69014d085af0cf3327741691df6a /src/qregisters.cpp
parent3551924ccd580a59190ac80e25c59b729ec4f613 (diff)
support UNIX-shell-like tilde-expansions in file names and directories
* expands to the value of $HOME (the env variable instead of the register which currently makes a slight difference). * supported for tab-completions * supported for all file-name accepting commands. The expansion is done centrally in StateExpectFile::done(). A new virtual method StateExpectFile::got_file() has been introduced to pass the expanded/processed file name to command implementations. * sciteco(7) has been updated: There is now a separate section on file name arguments and file name handling in SciTECO. This information is important but has been scattered across the document previously. * optimized is_glob_pattern() in glob.h
Diffstat (limited to 'src/qregisters.cpp')
-rw-r--r--src/qregisters.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/qregisters.cpp b/src/qregisters.cpp
index f15f0d7..20c1380 100644
--- a/src/qregisters.cpp
+++ b/src/qregisters.cpp
@@ -831,13 +831,13 @@ StateEQCommand::got_register(QRegister &reg)
}
State *
-StateLoadQReg::done(const gchar *str)
+StateLoadQReg::got_file(const gchar *filename)
{
BEGIN_EXEC(&States::start);
- if (*str) {
+ if (*filename) {
/* Load file into Q-Register */
- register_argument->load(str);
+ register_argument->load(filename);
} else {
/* Edit Q-Register */
current_doc_undo_edit();
@@ -871,10 +871,10 @@ StateEPctCommand::got_register(QRegister &reg)
}
State *
-StateSaveQReg::done(const gchar *str)
+StateSaveQReg::got_file(const gchar *filename)
{
BEGIN_EXEC(&States::start);
- register_argument->save(str);
+ register_argument->save(filename);
return &States::start;
}
@@ -1158,12 +1158,12 @@ StateMacro::got_register(QRegister &reg)
* If <file> could not be read, the command yields an error.
*/
State *
-StateMacroFile::done(const gchar *str)
+StateMacroFile::got_file(const gchar *filename)
{
BEGIN_EXEC(&States::start);
/* don't create new local Q-Registers if colon modifier is given */
- Execute::file(str, !eval_colon());
+ Execute::file(filename, !eval_colon());
return &States::start;
}