aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/qreg-commands.c
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2024-09-19 03:05:15 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2024-09-19 03:34:03 +0200
commit8fbd0b3ff42ae10c3735801ad17f5345fdc77766 (patch)
tree20db24f18d1b07d733478457a6455a5262b74ab3 /src/qreg-commands.c
parent16c3089a1154f146dbab6a9d43f1c5df1c89739e (diff)
downloadsciteco-8fbd0b3ff42ae10c3735801ad17f5345fdc77766.tar.gz
"special" Q-Registers now support EQq/.../ (load) and E%q/.../ (save) commands
* @EQ$/.../ sets the current directory from the contents of the given file. @E%$/.../ stores the currend directory in the given file. * @EQ*/.../ will fail, just like ^U*...$. @E%*/.../ stores the current buffer's name in the given file. * It's especially useful with the clipboard registers. There could still be a minor bug in @E%~/.../ with regard to EOL normalization as teco_view_save() will use the EOL style of the current document, which may not be the style of the Q-Reg contents. Conversions can generally be avoided for these particular commands. But without teco_view_save() we'd have to care about save point creation.
Diffstat (limited to 'src/qreg-commands.c')
-rw-r--r--src/qreg-commands.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qreg-commands.c b/src/qreg-commands.c
index a96eb5f..41e4465 100644
--- a/src/qreg-commands.c
+++ b/src/qreg-commands.c
@@ -149,7 +149,7 @@ teco_state_loadqreg_done(teco_machine_main_t *ctx, const teco_string_t *str, GEr
if (str->len > 0) {
/* Load file into Q-Register */
g_autofree gchar *filename = teco_file_expand_path(str->data);
- if (!teco_qreg_load(qreg, filename, error))
+ if (!qreg->vtable->load(qreg, filename, error))
return NULL;
} else {
/* Edit Q-Register */
@@ -202,7 +202,7 @@ teco_state_saveqreg_done(teco_machine_main_t *ctx, const teco_string_t *str, GEr
return &teco_state_start;
g_autofree gchar *filename = teco_file_expand_path(str->data);
- return teco_qreg_save(qreg, filename, error) ? &teco_state_start : NULL;
+ return qreg->vtable->save(qreg, filename, error) ? &teco_state_start : NULL;
}
/*$ E% E%q