hints kitten: Add an option --ascending to control if the hints numbers increase or decrease from top to bottom

This commit is contained in:
Kovid Goyal 2019-11-28 09:20:02 +05:30
parent 652eec3033
commit 5f7bcae072
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 12 additions and 1 deletions

View File

@ -10,6 +10,9 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
- Fix a crash/incorrect rendering when detaching a window in some circumstances
(:iss:`2173`)
- hints kitten: Add an option :option:`kitty +kitten hints --ascending` to
control if the hints numbers increase or decrease from top to bottom
0.15.0 [2019-11-27]
--------------------

View File

@ -355,7 +355,10 @@ def run(args, text, extra_cli_args=()):
largest_index = all_marks[-1].index
offset = max(0, args.hints_offset)
for m in all_marks:
m.index = largest_index - m.index + offset
if args.ascending:
m.index += offset
else:
m.index = largest_index - m.index + offset
index_map = {m.index: m for m in all_marks}
except Exception:
import traceback
@ -451,6 +454,11 @@ unless you specify the hints offset as zero the first match will be highlighted
the second character you specify.
--ascending
type=bool-set
Have the hints increase from top to bottom instead of decreasing from top to bottom.
--customize-processing
Name of a python file in the kitty config directory which will be imported to provide
custom implementations for pattern finding and performing actions