Skip to content

Commit

Permalink
Make preview cursor an underline
Browse files Browse the repository at this point in the history
This restores functionality from gokcehan#924
reverted in gokcehan@b47cf6d5a5, while
fixing gokcehan#1038.

Unlike before, the cursor in the preview column is now an underline
rather than a grey background. This seems to work on most terminals.
In no case should the visibility of the file name itself be affected.

For messages such as "empty" or "permission denied", the preview
cursor is the same as the active cursor for now.

There is no configuration, but there is nothing preventing adding
config as discussed in gokcehan#1038
in the future.

![Screenshot](https://user-images.githubusercontent.com/4123047/209767426-abcbddd4-965a-43a8-a5a8-6242681bbd98.png)
  • Loading branch information
ilyagr committed Jan 2, 2023
1 parent b47cf6d commit 9709bdf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,11 @@ func (win *win) printDir(screen tcell.Screen, dir *dir, context *dirContext, dir
}

if i == dir.pos {
st = st.Reverse(true)
if dirStyle.previewing {
st = st.Underline(true)
} else {
st = st.Reverse(true)
}
}

var s []rune
Expand Down

0 comments on commit 9709bdf

Please sign in to comment.