aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/interface-curses.h
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2015-03-01 17:56:34 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2015-03-01 18:20:27 +0100
commit83ebaea1abc39cae990e0fd22b6e4b428abfa95f (patch)
treed297dab707836d05b9d46bad621b8e02d6506ab9 /src/interface-curses.h
parent68eb8e5c427877abae43f2e2aba7fcca5a3471de (diff)
downloadsciteco-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-curses.h')
-rw-r--r--src/interface-curses.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/interface-curses.h b/src/interface-curses.h
index cab2031..8ee8811 100644
--- a/src/interface-curses.h
+++ b/src/interface-curses.h
@@ -74,9 +74,12 @@ typedef class InterfaceCurses : public Interface<InterfaceCurses, ViewCurses> {
WINDOW *info_window;
gchar *info_current;
+
WINDOW *msg_window;
+
WINDOW *cmdline_window;
- gchar *cmdline_current;
+ chtype *cmdline_current;
+ gsize cmdline_len, cmdline_rubout_len;
struct Popup {
WINDOW *window;
@@ -101,7 +104,8 @@ public:
info_current(NULL),
msg_window(NULL),
cmdline_window(NULL),
- cmdline_current(NULL) {}
+ cmdline_current(NULL),
+ cmdline_len(0), cmdline_rubout_len(0) {}
~InterfaceCurses();
/* implementation of Interface::main() */
@@ -116,11 +120,11 @@ public:
void show_view_impl(ViewCurses *view);
/* implementation of Interface::info_update() */
- void info_update_impl(QRegister *reg);
- void info_update_impl(Buffer *buffer);
+ void info_update_impl(const QRegister *reg);
+ void info_update_impl(const Buffer *buffer);
/* implementation of Interface::cmdline_update() */
- void cmdline_update_impl(const gchar *cmdline = NULL);
+ void cmdline_update_impl(const Cmdline *cmdline);
/* implementation of Interface::popup_add() */
void popup_add_impl(PopupEntryType type,
@@ -144,6 +148,10 @@ private:
void resize_all_windows(void);
void draw_info(void);
+ void format_chr(chtype *&target, gchar chr,
+ attr_t attr = 0);
+ void draw_cmdline(void);
+
friend void event_loop_iter();
} InterfaceCurrent;