diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2015-03-01 17:56:34 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2015-03-01 18:20:27 +0100 |
commit | 83ebaea1abc39cae990e0fd22b6e4b428abfa95f (patch) | |
tree | d297dab707836d05b9d46bad621b8e02d6506ab9 /src/interface.h | |
parent | 68eb8e5c427877abae43f2e2aba7fcca5a3471de (diff) | |
download | sciteco-83ebaea1abc39cae990e0fd22b6e4b428abfa95f.tar.gz |
keep rubbed out command line for later re-insertion and massive Cmdline cleanup/refactoring
* characters rubbed out are not totally removed from the command line,
but only from the *effective* command line.
* The rubbed out command line is displayed after the command line cursor.
On Curses it is grey and underlined.
* When characters are inserted that are on the rubbed out part of the command line,
the cursor simply moves forward.
NOTE: There's currently no immediate editing command for reinserting the
next character/word from the rubbed out command line.
* Characters resulting in errors are no longer simply discarded but rubbed out,
so they will stay in the rubbed out part of the command line, reminding you
which character caused the error.
* Improved Cmdline formatting on Curses UI:
* Asterisk is printed bold
* Control characters are printed in REVERSE style, similar to what
Scinterm does. The controll character formatting has thus been moved
from macro_echo() in cmdline.cpp to the UI implementations.
* Updated the GTK+ UI (UNTESTED): I did only, the most important API
adaptions. The command line still does not use any colors.
* Refactored entire command line handling:
* The command line is now a class (Cmdline), and most functions
in cmdline.cpp have been converted to methods.
* Esp. process_edit_cmd() (now Cmdline::process_edit_cmd()) has been
simplified. There is no longer the possibility of a buffer overflow
because of static insertion buffer sizes
* Cleaned up usage of the cmdline_pos variable (now Cmdline::pc) which
is really a program counter that used a different origin as macro_pc
which was really confusing.
* The new Cmdline class is theoretically 8-bit clean. However all of this
will change again when we introduce Scintilla views for the command line.
* Added 8-bit clean (null-byte aware) versions of QRegisterData::set_string()
and QRegisterData::append_string()
Diffstat (limited to 'src/interface.h')
-rw-r--r-- | src/interface.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/interface.h b/src/interface.h index 8f37668..6c847f4 100644 --- a/src/interface.h +++ b/src/interface.h @@ -32,6 +32,7 @@ namespace SciTECO { /* avoid include dependency conflict */ class QRegister; class Buffer; +class Cmdline; extern sig_atomic_t sigint_occurred; /** @@ -170,10 +171,10 @@ class Interface { template <class Type> class UndoTokenInfoUpdate : public UndoTokenWithSize< UndoTokenInfoUpdate<Type> > { - Type *obj; + const Type *obj; public: - UndoTokenInfoUpdate(Type *_obj) + UndoTokenInfoUpdate(const Type *_obj) : obj(_obj) {} void run(void); @@ -257,30 +258,29 @@ public: * by the deriving class. */ inline void - info_update(QRegister *reg) + info_update(const QRegister *reg) { impl().info_update_impl(reg); } inline void - info_update(Buffer *buffer) + info_update(const Buffer *buffer) { impl().info_update_impl(buffer); } inline void - undo_info_update(QRegister *reg) + undo_info_update(const QRegister *reg) { undo.push(new UndoTokenInfoUpdate<QRegister>(reg)); } inline void - undo_info_update(Buffer *buffer) + undo_info_update(const Buffer *buffer) { undo.push(new UndoTokenInfoUpdate<Buffer>(buffer)); } - /* NULL means to redraw the current cmdline if necessary */ inline void - cmdline_update(const gchar *cmdline = NULL) + cmdline_update(const Cmdline *cmdline) { impl().cmdline_update_impl(cmdline); } |