Skip to content

Commit 5f7bcae

Browse files
committed
hints kitten: Add an option --ascending to control if the hints numbers increase or decrease from top to bottom
1 parent 652eec3 commit 5f7bcae

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

docs/changelog.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
1010
- Fix a crash/incorrect rendering when detaching a window in some circumstances
1111
(:iss:`2173`)
1212

13+
- hints kitten: Add an option :option:`kitty +kitten hints --ascending` to
14+
control if the hints numbers increase or decrease from top to bottom
15+
1316

1417
0.15.0 [2019-11-27]
1518
--------------------

kittens/hints/main.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,10 @@ def run(args, text, extra_cli_args=()):
355355
largest_index = all_marks[-1].index
356356
offset = max(0, args.hints_offset)
357357
for m in all_marks:
358-
m.index = largest_index - m.index + offset
358+
if args.ascending:
359+
m.index += offset
360+
else:
361+
m.index = largest_index - m.index + offset
359362
index_map = {m.index: m for m in all_marks}
360363
except Exception:
361364
import traceback
@@ -451,6 +454,11 @@ def run(args, text, extra_cli_args=()):
451454
the second character you specify.
452455
453456
457+
--ascending
458+
type=bool-set
459+
Have the hints increase from top to bottom instead of decreasing from top to bottom.
460+
461+
454462
--customize-processing
455463
Name of a python file in the kitty config directory which will be imported to provide
456464
custom implementations for pattern finding and performing actions

0 commit comments

Comments
 (0)