git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonas Fonseca <fonseca@diku.dk>
To: Ted Pavlic <ted@tedpavlic.com>
Cc: git <git@vger.kernel.org>
Subject: Re: [ANNOUNCE] tig-0.14
Date: Wed, 25 Feb 2009 22:54:38 +0100	[thread overview]
Message-ID: <2c6b72b30902251354k25cf97dfh66a3026385f5aa8d@mail.gmail.com> (raw)
In-Reply-To: <499F143B.7080708@tedpavlic.com>

[-- Attachment #1: Type: text/plain, Size: 385 bytes --]

On Fri, Feb 20, 2009 at 21:36, Ted Pavlic <ted@tedpavlic.com> 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

[-- Attachment #2: 0001-Fix-regression-where-a-line-was-not-cleared-when-not.patch --]
[-- Type: text/x-diff, Size: 1758 bytes --]

From 5458881439b362b6d729500bc7d67bd100cdd8b4 Mon Sep 17 00:00:00 2001
From: Jonas Fonseca <fonseca@diku.dk>
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


  parent reply	other threads:[~2009-02-25 21:56 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-05 20:44 [ANNOUNCE] tig-0.14 Jonas Fonseca
2009-02-06 10:49 ` bill lam
2009-02-06 14:29   ` Jonas Fonseca
2009-02-06 15:25     ` Sitaram Chamarty
2009-02-08 10:07       ` Jonas Fonseca
2009-02-11 16:05         ` showing SHA1 of parent commit in tig [was " Sitaram Chamarty
2009-02-12  1:19           ` Jonas Fonseca
2009-02-12  3:28             ` Sitaram Chamarty
2009-02-06 19:15 ` Jeff King
2009-02-06 22:10   ` Jonas Fonseca
2009-02-06 22:53     ` Jakub Narebski
2009-02-08 10:13       ` Jonas Fonseca
2009-02-07  7:10     ` Jeff King
2009-02-07  7:28       ` Junio C Hamano
2009-02-07  8:55         ` david
2009-02-08 10:47           ` Jonas Fonseca
2009-02-08 10:55             ` Jonas Fonseca
2009-02-08 11:06               ` Jeff King
2009-02-08 11:52                 ` Jonas Fonseca
2009-02-07 11:26         ` Jeff King
2009-02-08 10:31       ` Jonas Fonseca
2009-02-08 11:00         ` Jeff King
2009-02-08 11:49           ` Jonas Fonseca
2009-02-07  2:48 ` Mikael Magnusson
2009-02-09 22:07 ` Peter Baumann
2009-02-09 22:22   ` Jeff King
2009-02-09 22:30     ` Peter Baumann
2009-02-10 18:42       ` Jonas Fonseca
2009-02-10 21:23         ` Jari Aalto
2009-02-10 13:29 ` Ted Pavlic
2009-02-10 18:29   ` Jonas Fonseca
2009-02-10 19:07     ` Brian Gernhardt
2009-02-10 19:29       ` Stefan Karpinski
2009-02-10 20:41         ` Jonas Fonseca
2009-02-10 20:49           ` Brian Gernhardt
2009-02-10 21:13             ` Jonas Fonseca
2009-02-10 21:18               ` Brian Gernhardt
2009-02-11 14:06             ` Ted Pavlic
2009-02-12  1:30               ` Jonas Fonseca
2009-02-11 14:19           ` Ted Pavlic
2009-02-20 17:24           ` Ted Pavlic
2009-02-20 18:34             ` Jonas Fonseca
2009-02-20 20:36               ` Ted Pavlic
2009-02-20 23:31                 ` Jonas Fonseca
2009-02-25 21:54                 ` Jonas Fonseca [this message]
2009-02-11 14:03     ` Ted Pavlic
2009-02-11 14:12       ` Ted Pavlic
2009-02-11 17:47 ` Ted Pavlic
2009-02-12  1:08   ` Jonas Fonseca
2009-02-12 21:48 ` Tilo Schwarz
2009-02-12 22:24   ` Jonas Fonseca
2009-02-12 23:14     ` Tilo Schwarz
2009-02-15 23:47       ` Jonas Fonseca
2009-02-16  1:33         ` Sitaram Chamarty
2009-02-16 12:10           ` Jonas Fonseca
2009-02-16 15:14             ` Sitaram Chamarty
2009-02-16 15:25               ` Thomas Adam
2009-02-16 19:52                 ` Jonas Fonseca
2009-02-17  7:47                   ` Marco Costalba
2009-02-16 21:12         ` Tilo Schwarz
2009-02-20 23:35           ` Jonas Fonseca
2009-02-21 17:35             ` Tilo Schwarz
2009-02-21 17:41               ` Jonas Fonseca
2009-02-21 20:18                 ` Tilo Schwarz
2009-02-16 21:55         ` Tilo Schwarz
2009-02-13  2:31     ` bill lam
2009-02-13 23:57       ` Jonas Fonseca
2009-02-14  3:31         ` bill lam
2009-02-15 23:22           ` Jonas Fonseca

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2c6b72b30902251354k25cf97dfh66a3026385f5aa8d@mail.gmail.com \
    --to=fonseca@diku.dk \
    --cc=git@vger.kernel.org \
    --cc=ted@tedpavlic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).