summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 73771ec)
raw | patch | inline | side by side (parent: 73771ec)
author | Jonas Fonseca <fonseca@diku.dk> | |
Sat, 31 Jan 2009 09:01:04 +0000 (10:01 +0100) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Mon, 2 Feb 2009 08:28:20 +0000 (09:28 +0100) |
Switch to use wnoutrefresh everywhere and call doupdate in the get_input
loop. This allows multiple updates to be made while only one burst of
IO occurs.
loop. This allows multiple updates to be made while only one burst of
IO occurs.
BUGS | patch | blob | history | |
tig.c | patch | blob | history |
index 35c834450a11067d21b47254308757514f5f9643..7849737f13dfdcfeccfab5417f9557cfe1be89d0 100644 (file)
--- a/BUGS
+++ b/BUGS
- Proper locale support: in it's current state tig is pretty much UTF-8 only.
- Horizontal scrolling.
+
+ - In the gnome-terminal-emulator, the message from scrolling up one line
+ when impossible followed by scrolling down one line causes corruption of
+ the status line.
index 90e03735ef9a1be09901bd85d6f0b71c0ce81d9b..486b0c7444cd29526195bdb7faa61511c3505c42 100644 (file)
--- a/tig.c
+++ b/tig.c
static struct view *display[2];
static unsigned int current_view;
-/* Reading from the prompt? */
-static bool input_mode = FALSE;
-
#define foreach_displayed_view(view, i) \
for (i = 0; i < ARRAY_SIZE(display) && (view = display[i]); i++)
if (!dirty)
return;
- if (input_mode)
- wnoutrefresh(view->win);
- else
- wrefresh(view->win);
+ wnoutrefresh(view->win);
}
static void
break;
}
- if (input_mode)
- wnoutrefresh(view->win);
- else
- wrefresh(view->win);
+ wnoutrefresh(view->win);
}
static void
* the cursor does not jump around. */
if (view->lines) {
wmove(view->win, view->lineno - view->offset, view->width - 1);
- wrefresh(view->win);
+ wnoutrefresh(view->win);
}
}
mvwaddnstr(view->title, 0, 0, buf, bufpos);
wclrtoeol(view->title);
wmove(view->title, 0, view->width - 1);
-
- if (input_mode)
- wnoutrefresh(view->title);
- else
- wrefresh(view->title);
+ wnoutrefresh(view->title);
}
static void
if (redraw_current_line)
draw_view_line(view, view->lineno - view->offset);
- /* FIXME: Stupid hack to workaround bug where the message from
- * scrolling up one line when impossible followed by scrolling
- * down one line is not removed by the next action. */
- if (lines > 0)
- report("");
- wrefresh(view->win);
+ wnoutrefresh(view->win);
}
report("");
/* Draw the current line */
draw_view_line(view, view->lineno - view->offset);
- wrefresh(view->win);
+ wnoutrefresh(view->win);
report("");
}
if (view_is_displayed(view)) {
draw_view_line(view, old_lineno);
draw_view_line(view, view->lineno - view->offset);
- wrefresh(view->win);
+ wnoutrefresh(view->win);
} else {
view->ops->select(view, &view->line[view->lineno]);
}
/* The status window is used for polling keystrokes. */
static WINDOW *status_win;
+/* Reading from the prompt? */
+static bool input_mode = FALSE;
+
static bool status_empty = FALSE;
/* Update status and title window. */
status_empty = TRUE;
}
wclrtoeol(status_win);
- wrefresh(status_win);
+ wnoutrefresh(status_win);
va_end(args);
}
update_view(view);
/* Refresh, accept single keystroke of input */
+ doupdate();
key = wgetch(status_win);
/* wgetch() with nodelay() enabled returns ERR when
* there's no input. */
if (key == ERR) {
- doupdate();
} else if (key == KEY_RESIZE) {
int height, width;
* placed properly. */
wresize(status_win, 1, width);
mvwin(status_win, height - 1, 0);
- wrefresh(status_win);
+ wnoutrefresh(status_win);
resize_display();
redraw_display(TRUE);