diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2014-11-22 19:30:58 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2014-11-22 19:52:47 +0100 |
commit | a6c13d77f2f5f504c7b99e66db5f7d52c1368b8a (patch) | |
tree | cb952691971c790a2b951dc5cac6068097355bb2 /src/qregisters.cpp | |
parent | 3af77d3e21cc154a24ecf37b83b217066d296ec9 (diff) | |
download | sciteco-a6c13d77f2f5f504c7b99e66db5f7d52c1368b8a.tar.gz |
allow setting the "*" register as an alternative to nEB
this is more consistent with SciTECO's idea of abstract registers
and allows the currend buffer to be saved on the Q-Register stack.
This allows the idiom: [* ! ...change current buffer... ! ]*
Diffstat (limited to 'src/qregisters.cpp')
-rw-r--r-- | src/qregisters.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/qregisters.cpp b/src/qregisters.cpp index 24ca904..846a5a4 100644 --- a/src/qregisters.cpp +++ b/src/qregisters.cpp @@ -229,16 +229,24 @@ QRegister::load(const gchar *filename) } tecoInt -QRegisterBufferInfo::get_integer(void) +QRegisterBufferInfo::set_integer(tecoInt v) { - tecoInt id = 1; + if (!ring.edit(v)) + throw Error("Invalid buffer id %" TECO_INTEGER_FORMAT, v); - for (Buffer *buffer = ring.first(); - buffer != ring.current; - buffer = buffer->next()) - id++; + return v; +} - return id; +void +QRegisterBufferInfo::undo_set_integer(void) +{ + current_doc_undo_edit(); +} + +tecoInt +QRegisterBufferInfo::get_integer(void) +{ + return ring.get_id(); } gchar * |