Re: [PATCH v2] gitk: make pointer selection visible in highlighted lines

2013-12-02 Thread Max Kirillov
On Mon, Dec 02, 2013 at 11:04:09AM +0100, Stefan Haller wrote:
> I don't think that not selecting the search hint is an
> option: the selection is used to keep track of where to
> search next.

To mark the next found position, should a 0-length selection
be enough? I will try to experiment with it.

> Can't we just raise the currentsearchhit tag above the sel
> tag?

This also seems to help, as far as I understod
currentsearchhit is always removed as interactive selection
starts, so it should not hide manual selection.

-- 
Max
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] gitk: make pointer selection visible in highlighted lines

2013-12-02 Thread Stefan Haller
Paul Mackerras  wrote:

> On Thu, Nov 28, 2013 at 11:20:18PM +0200, Max Kirillov wrote:
> > Custom tags have higher priority than `sel`, and when they define their
> > own background, it makes selection invisible. Especially inconvenient
> > for `filesep` (to select filenames), but also affects other tags.
> > Use `tag raise` to fix `sel`'s priority.
> > 
> > Also change `omark` tag handling, so that it is created once, together
> > with others, and then only removed from text rather than deleted. Then
> > it will not get larger priority than the `sel` tag.
> 
> This conflicts with the recent change to highlight the current search
> hit in orange (c46149, "gitk: Highlight current search hit in
> orange").  With the selection being the highest-priority tag, the
> current search hit gets shown in grey instead.  I think I prefer the
> orange.  I agree though that if the user explicitly selects part of
> the text using the mouse, the selection highlight should be the
> highest priority in that case.  Maybe the solution is to not select
> the search hit automatically?

I don't think that not selecting the search hint is an option: the
selection is used to keep track of where to search next.

Can't we just raise the currentsearchhit tag above the sel tag?


-- 
Stefan Haller
Berlin, Germany
http://www.haller-berlin.de/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] gitk: make pointer selection visible in highlighted lines

2013-12-01 Thread Paul Mackerras
On Thu, Nov 28, 2013 at 11:20:18PM +0200, Max Kirillov wrote:
> Custom tags have higher priority than `sel`, and when they define their
> own background, it makes selection invisible. Especially inconvenient
> for `filesep` (to select filenames), but also affects other tags.
> Use `tag raise` to fix `sel`'s priority.
> 
> Also change `omark` tag handling, so that it is created once, together
> with others, and then only removed from text rather than deleted. Then
> it will not get larger priority than the `sel` tag.

This conflicts with the recent change to highlight the current search
hit in orange (c46149, "gitk: Highlight current search hit in
orange").  With the selection being the highest-priority tag, the
current search hit gets shown in grey instead.  I think I prefer the
orange.  I agree though that if the user explicitly selects part of
the text using the mouse, the selection highlight should be the
highest priority in that case.  Maybe the solution is to not select
the search hit automatically?

Paul.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2] gitk: make pointer selection visible in highlighted lines

2013-11-28 Thread Max Kirillov
Custom tags have higher priority than `sel`, and when they define their
own background, it makes selection invisible. Especially inconvenient
for `filesep` (to select filenames), but also affects other tags.
Use `tag raise` to fix `sel`'s priority.

Also change `omark` tag handling, so that it is created once, together
with others, and then only removed from text rather than deleted. Then
it will not get larger priority than the `sel` tag.

Signed-off-by: Max Kirillov 
---

Fixed the typo in the comment and selection of text in marked line

 gitk | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/gitk b/gitk
index 1dd5137..491a1fa 100755
--- a/gitk
+++ b/gitk
@@ -2029,6 +2029,7 @@ proc makewindow {} {
 global headctxmenu progresscanv progressitem progresscoords statusw
 global fprogitem fprogcoord lastprogupdate progupdatepending
 global rprogitem rprogcoord rownumsel numcommits
+global markbgcolor
 global have_tk85 use_ttk NS
 global git_version
 global worddiff
@@ -2376,6 +2377,8 @@ proc makewindow {} {
 $ctext tag conf found -back yellow
 $ctext tag conf currentsearchhit -back orange
 $ctext tag conf wwrap -wrap word
+$ctext tag conf omark -background $markbgcolor
+$ctext tag raise sel
 
 .pwbottom add .bleft
 if {!$use_ttk} {
@@ -7439,11 +7442,10 @@ proc getblobline {bf id} {
 }
 
 proc mark_ctext_line {lnum} {
-global ctext markbgcolor
+global ctext
 
-$ctext tag delete omark
+$ctext tag remove omark 1.0 end
 $ctext tag add omark $lnum.0 "$lnum.0 + 1 line"
-$ctext tag conf omark -background $markbgcolor
 $ctext see $lnum.0
 }
 
-- 
1.8.4.2.1566.g3c1a064

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html