git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Max Kirillov <max@max630.net>
Date
Nov 28, 2013, 21:20 UTC
Message-ID
<20131128212018.GA24615@wheezy.local>
In-Reply-To
<20131127180601.GA31211@wheezy.local>

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 <max@max630.net>
---
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
Previous: Eric SunshineNext: Paul Mackerras
Message 4 of 8 in “gitk: make pointer selection visible in highlighted lines”
  1. gitk: make pointer selection visible in highlighted linesMax Kirillov, Nov 27, 2013
  2. Thomas RastNov 27, 2013
  3. Eric SunshineNov 27, 2013
  4. gitk: make pointer selection visible in highlighted linesMax Kirillov, Nov 28, 2013
  5. Paul MackerrasDec 1, 2013
  6. Stefan HallerDec 2, 2013
  7. Max KirillovDec 3, 2013
  8. [RFC] HACK: use anchor mark instead of sel tagMax Kirillov, Dec 11, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.