Re: [ANNOUNCE] tig-0.14

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 20, 2009 at 21:36, Ted Pavlic <ted@xxxxxxxxxxxxx> wrote:
> Both patches (the new and the old) seem to fix the original problem.
>
> However, I now notice that both patches introduces a new problem.

I finally found a way to reproduce and bisect this today on a linux
box with ncurses-5.5 installed. To double check can you please try
this third version?

-- 
Jonas Fonseca
From 5458881439b362b6d729500bc7d67bd100cdd8b4 Mon Sep 17 00:00:00 2001
From: Jonas Fonseca <fonseca@xxxxxxx>
Date: Tue, 10 Feb 2009 21:33:18 +0100
Subject: [PATCH] Fix regression where a line was not cleared when not selected anymore

Introduced in 792d0e0931fb8785135a6b5d250a570a597c7324 which tried to
eliminated unneeded calls to redrawwin(). However, for older ncurses
versions (5.5) this caused problems. To fix this explicitly mark newly
selected lines using wtouchln(), so they are properly redrawn.
---
 tig.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/tig.c b/tig.c
index 2a3ab3a..df2b4f6 100644
--- a/tig.c
+++ b/tig.c
@@ -2073,6 +2073,7 @@ draw_view_line(struct view *view, unsigned int lineno)
 {
 	struct line *line;
 	bool selected = (view->offset + lineno == view->lineno);
+	bool cleareol;
 
 	assert(view_is_displayed(view));
 
@@ -2080,10 +2081,9 @@ draw_view_line(struct view *view, unsigned int lineno)
 		return FALSE;
 
 	line = &view->line[view->offset + lineno];
+	cleareol = line->cleareol || (line->selected && !selected);
 
 	wmove(view->win, lineno, 0);
-	if (line->cleareol)
-		wclrtoeol(view->win);
 	view->col = 0;
 	view->curline = line;
 	view->curtype = LINE_NONE;
@@ -2094,6 +2094,12 @@ draw_view_line(struct view *view, unsigned int lineno)
 		set_view_attr(view, LINE_CURSOR);
 		line->selected = TRUE;
 		view->ops->select(view, line);
+		touchline(view->win, lineno, 1);
+	} else if (cleareol) {
+		/* FIXME: It is not strictly correct to only clear to
+		 * the line end for non-selected lines. However, no view
+		 * currently requires clearing for the first line. */
+		wclrtoeol(view->win);
 	}
 
 	return view->ops->draw(view, line, lineno);
-- 
1.6.2.rc1.209.gfe624.dirty


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux