chiark
/
gitweb
/
~mdw
/
tig
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b3a54cb
)
End the current update before begining a new one; fixes CPU hogging
author
Jonas Fonseca
<fonseca@diku.dk>
Sun, 21 May 2006 23:04:49 +0000
(
01:04
+0200)
committer
Jonas Fonseca
<fonseca@antimatter.localdomain>
Sun, 21 May 2006 23:04:49 +0000
(
01:04
+0200)
tig.c
patch
|
blob
|
blame
|
history
diff --git
a/tig.c
b/tig.c
index bf5309254db1ac46aa89a25e4db7a545fbed16cb..236c701935d1689ad2278c65820999fee65b1844 100644
(file)
--- a/
tig.c
+++ b/
tig.c
@@
-1075,11
+1075,27
@@
move_view(struct view *view, enum request request, bool redraw)
* Incremental updating
*/
* Incremental updating
*/
+static void
+end_update(struct view *view)
+{
+ if (!view->pipe)
+ return;
+ set_nonblocking_input(FALSE);
+ if (view->pipe == stdin)
+ fclose(view->pipe);
+ else
+ pclose(view->pipe);
+ view->pipe = NULL;
+}
+
static bool
begin_update(struct view *view)
{
const char *id = view->id;
static bool
begin_update(struct view *view)
{
const char *id = view->id;
+ if (view->pipe)
+ end_update(view);
+
if (opt_cmd[0]) {
string_copy(view->cmd, opt_cmd);
opt_cmd[0] = 0;
if (opt_cmd[0]) {
string_copy(view->cmd, opt_cmd);
opt_cmd[0] = 0;
@@
-1128,19
+1144,6
@@
begin_update(struct view *view)
return TRUE;
}
return TRUE;
}
-static void
-end_update(struct view *view)
-{
- if (!view->pipe)
- return;
- set_nonblocking_input(FALSE);
- if (view->pipe == stdin)
- fclose(view->pipe);
- else
- pclose(view->pipe);
- view->pipe = NULL;
-}
-
static bool
update_view(struct view *view)
{
static bool
update_view(struct view *view)
{