From ec510eda5f080d39906c396a36cba89188031640 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Tue, 20 Nov 2012 00:43:18 +0100 Subject: local Q-Register tables; :M command * munged files use the same local Q-Registers as commandline * :M calls macro without new set of local registers (local register names refer to the parent macro level) * only .x names accepted at the moment. for string building characters, this will like stay that way (cannot refer to extended/long names) --- main.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index 552b1e0..312064f 100644 --- a/main.cpp +++ b/main.cpp @@ -101,6 +101,7 @@ int main(int argc, char **argv) { static GotoTable cmdline_goto_table; + static QRegisterTable local_qregs; process_options(argc, argv); @@ -116,7 +117,15 @@ main(int argc, char **argv) interface.ssm(SCI_STYLESETFONT, STYLE_DEFAULT, (sptr_t)"Courier"); interface.ssm(SCI_STYLECLEARALL); - qregisters.initialize(); + QRegisters::globals.initialize(); + /* search string and status register */ + QRegisters::globals.initialize("_"); + /* current buffer name and number ("*") */ + QRegisters::globals.insert(new QRegisterBufferInfo()); + + local_qregs.initialize(); + QRegisters::locals = &local_qregs; + ring.edit(NULL); /* add remaining arguments to unnamed buffer */ @@ -126,7 +135,7 @@ main(int argc, char **argv) } if (g_file_test(mung_file, G_FILE_TEST_IS_REGULAR)) { - if (!file_execute(mung_file)) + if (!file_execute(mung_file, false)) exit(EXIT_FAILURE); /* FIXME: make quit immediate in commandline mode (non-UNDO)? */ if (quit_requested) { -- cgit v1.2.3