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

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to