From 1e5115b0b40bcf57501d4b0b5dce8e7ecd61432d Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Mon, 24 Nov 2014 04:57:26 +0100 Subject: Q-Register loading and saving using the IOView class * EW can save Q-Registers now * the new E% may be used to save a q-register without making it the current document --- src/ring.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/ring.cpp') diff --git a/src/ring.cpp b/src/ring.cpp index e7f7d75..df80246 100644 --- a/src/ring.cpp +++ b/src/ring.cpp @@ -372,7 +372,7 @@ StateEditFile::done(const gchar *str) } /*$ - * EW$ -- Save or rename current buffer + * EW$ -- Save current buffer or Q-Register * EWfile$ * * Saves the current buffer to disk. @@ -381,6 +381,13 @@ StateEditFile::done(const gchar *str) * the buffer is saved with the specified file name * and is renamed in the ring. * + * The EW command also works if the current document + * is a Q-Register, i.e. a Q-Register is edited. + * In this case, the string contents of the current + * Q-Register are saved to . + * Q-Registers have no notion of associated file names, + * so must be always specified. + * * In interactive mode, EW is executed immediately and * may be rubbed out. * In order to support that, \*(ST creates so called @@ -411,8 +418,7 @@ StateSaveFile::done(const gchar *str) BEGIN_EXEC(&States::start); if (QRegisters::current) - throw Error("Cannot save Q-Register"); -// QRegisters::current->save(str); + QRegisters::current->save(str); else ring.current->save(*str ? str : NULL); -- cgit v1.2.3