summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6ad8ba9)
raw | patch | inline | side by side (parent: 6ad8ba9)
author | Jonas Fonseca <fonseca@diku.dk> | |
Sat, 27 Mar 2010 14:14:37 +0000 (10:14 -0400) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Mon, 29 Mar 2010 00:18:17 +0000 (20:18 -0400) |
tig.c | patch | blob | history |
index 3f2264a765012d4fb29288f6ebfa3c94647f9450..54d99a721378cee897c49df99e728b61357dba55 100644 (file)
--- a/tig.c
+++ b/tig.c
static void __NORETURN die(const char *err, ...);
static void warn(const char *msg, ...);
static void report(const char *msg, ...);
-static void set_nonblocking_input(bool loading);
static size_t utf8_length(const char **start, size_t skip, int *width, size_t max_width, int *trimmed, bool reserve, int tab_size);
static inline unsigned char utf8_char_length(const char *string, const char *end);
while (!view->ops->read(view, NULL))
if (!force)
return;
- set_nonblocking_input(FALSE);
if (force)
kill_io(view->pipe);
done_io(view->pipe);
static void
setup_update(struct view *view, const char *vid)
{
- set_nonblocking_input(TRUE);
reset_view(view);
string_copy_rev(view->vid, vid);
view->pipe = &view->io;
update_view_title(view);
}
-/* Controls when nodelay should be in effect when polling user input. */
-static void
-set_nonblocking_input(bool loading)
-{
- static unsigned int loading_views;
-
- if ((loading == FALSE && loading_views-- == 1) ||
- (loading == TRUE && loading_views++ == 0))
- nodelay(status_win, loading);
-}
-
static void
init_display(void)
{
{
struct view *view;
int i, key, cursor_y, cursor_x;
+ bool loading = FALSE;
if (prompt_position)
input_mode = TRUE;
use_scroll_redrawwin)
redrawwin(view->win);
view->has_scrolled = FALSE;
+ if (view->pipe)
+ loading = TRUE;
}
/* Update the cursor position. */
/* Refresh, accept single keystroke of input */
doupdate();
+ nodelay(status_win, loading);
key = wgetch(status_win);
/* wgetch() with nodelay() enabled returns ERR when