diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-16 15:35:48 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-16 15:35:48 +0100 |
commit | de99e1068e3158866c0a537c27f035ae3d350d1a (patch) | |
tree | 9b74061b983e16979e0ab172d3ea8819b43e8a25 /interface-ncurses.cpp | |
parent | fd726e35c77e2f212e3a09ac69e70a07a32cda48 (diff) | |
download | sciteco-de99e1068e3158866c0a537c27f035ae3d350d1a.tar.gz |
NCURSES interface: fix message displaying in batch mode (avoid any refresh)
Diffstat (limited to 'interface-ncurses.cpp')
-rw-r--r-- | interface-ncurses.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/interface-ncurses.cpp b/interface-ncurses.cpp index da54c9c..f57af4e 100644 --- a/interface-ncurses.cpp +++ b/interface-ncurses.cpp @@ -127,6 +127,9 @@ InterfaceNCurses::vmsg(MessageType type, const gchar *fmt, va_list ap) void InterfaceNCurses::draw_info(void) { + if (isendwin()) /* batch mode */ + return; + wmove(info_window, 0, 0); wbkgdset(info_window, ' ' | SCI_COLOR_ATTR(COLOR_BLACK, COLOR_WHITE)); waddstr(info_window, info_current); @@ -186,7 +189,12 @@ void InterfaceNCurses::popup_add_filename(PopupFileType type, const gchar *filename, bool highlight) { - gchar *entry = g_strconcat(highlight ? "*" : " ", filename, NULL); + gchar *entry; + + if (isendwin()) /* batch mode */ + return; + + entry = g_strconcat(highlight ? "*" : " ", filename, NULL); popup.longest = MAX(popup.longest, (gint)strlen(filename)); popup.length++; @@ -201,6 +209,9 @@ InterfaceNCurses::popup_show(void) int popup_lines; gint popup_cols, cur_file; + if (isendwin()) /* batch mode */ + goto cleanup; + getmaxyx(stdscr, lines, cols); popup.longest += 3; @@ -231,6 +242,7 @@ InterfaceNCurses::popup_show(void) } wclrtoeol(popup.window); +cleanup: g_slist_free(popup.list); popup.list = NULL; popup.longest = popup.length = 0; |