From 8fbd0b3ff42ae10c3735801ad17f5345fdc77766 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Thu, 19 Sep 2024 03:05:15 +0200 Subject: "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. --- src/ring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ring.c') diff --git a/src/ring.c b/src/ring.c index 5a9e74e..6a4eae5 100644 --- a/src/ring.c +++ b/src/ring.c @@ -524,7 +524,7 @@ teco_state_save_file_done(teco_machine_main_t *ctx, const teco_string_t *str, GE g_autofree gchar *filename = teco_file_expand_path(str->data); if (teco_qreg_current) { - if (!teco_qreg_save(teco_qreg_current, filename, error)) + if (!teco_qreg_current->vtable->save(teco_qreg_current, filename, error)) return NULL; } else { if (!teco_buffer_save(teco_ring_current, *filename ? filename : NULL, error)) -- cgit v1.2.3