sergeant 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/sergeant/modals/help.rb +36 -33
- data/lib/sergeant/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 41cc1fef750cecd3e0a9a530976e8818955bc0db86a434319420dbe250496405
|
|
4
|
+
data.tar.gz: 60db0f330203e559828d1cc87f701af503d174a6577bc351bfcc2fce2dc88752
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1b14250ce188e25a4c709b94ffcf16a88d57f4ceb715c737feaab66d1628fcbc041993ffc9e71c2e6496670e1f78846464932a804f392619608896f059aaf62f
|
|
7
|
+
data.tar.gz: 696600fa8dbf40b884949ca2cd1bb4ab16c21b5f1ec947fa77acb7593274638cbb54fb41be80a40ec820981e164ac9eeddf0643c6e9f52e0335b91ccd1c84b60
|
data/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
8
|
|
|
9
|
+
## [1.0.10] - 2026-08-24
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
- **Help modal silently truncating its own key list** - `show_help_modal` capped its height at a hardcoded value that no longer fit all the key mappings, cutting off everything from the ownership toggle (`o`) onward - including `b`, `H`, `R`, and even `q`/`ESC` to quit - on any normal-sized terminal. The modal now sizes itself from the actual number of key mappings, so it never happens again.
|
|
13
|
+
|
|
9
14
|
## [1.0.9] - 2026-08-19
|
|
10
15
|
|
|
11
16
|
### Added
|
data/lib/sergeant/modals/help.rb
CHANGED
|
@@ -9,39 +9,6 @@ module Sergeant
|
|
|
9
9
|
max_y = lines
|
|
10
10
|
max_x = cols
|
|
11
11
|
|
|
12
|
-
modal_height = [28, max_y - 4].min # Adaptive height
|
|
13
|
-
modal_width = [70, max_x - 4].min # Adaptive width
|
|
14
|
-
modal_y = (max_y - modal_height) / 2
|
|
15
|
-
modal_x = (max_x - modal_width) / 2
|
|
16
|
-
|
|
17
|
-
(modal_y..(modal_y + modal_height)).each do |y|
|
|
18
|
-
setpos(y, modal_x)
|
|
19
|
-
attron(color_pair(3)) do
|
|
20
|
-
addstr(' ' * modal_width)
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
setpos(modal_y, modal_x)
|
|
25
|
-
attron(color_pair(4) | Curses::A_BOLD) do
|
|
26
|
-
addstr("\u250C#{'─' * (modal_width - 2)}\u2510")
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
setpos(modal_y + 1, modal_x)
|
|
30
|
-
attron(color_pair(4) | Curses::A_BOLD) do
|
|
31
|
-
addstr('│')
|
|
32
|
-
end
|
|
33
|
-
attron(color_pair(5) | Curses::A_BOLD) do
|
|
34
|
-
addstr(' Key Mappings '.center(modal_width - 2))
|
|
35
|
-
end
|
|
36
|
-
attron(color_pair(4) | Curses::A_BOLD) do
|
|
37
|
-
addstr('│')
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
setpos(modal_y + 2, modal_x)
|
|
41
|
-
attron(color_pair(4)) do
|
|
42
|
-
addstr("\u251C#{'─' * (modal_width - 2)}\u2524")
|
|
43
|
-
end
|
|
44
|
-
|
|
45
12
|
help_lines = [
|
|
46
13
|
'Navigation:',
|
|
47
14
|
' ↑/k - Move up',
|
|
@@ -75,6 +42,42 @@ module Sergeant
|
|
|
75
42
|
' q / ESC - Quit and cd to current directory'
|
|
76
43
|
]
|
|
77
44
|
|
|
45
|
+
# Height must track the number of help lines - a fixed cap silently
|
|
46
|
+
# truncates the bottom of the list (including "quit"!) every time a
|
|
47
|
+
# new key mapping is added without also bumping the cap by hand.
|
|
48
|
+
modal_height = [help_lines.length + 4, max_y - 4].min
|
|
49
|
+
modal_width = [70, max_x - 4].min # Adaptive width
|
|
50
|
+
modal_y = (max_y - modal_height) / 2
|
|
51
|
+
modal_x = (max_x - modal_width) / 2
|
|
52
|
+
|
|
53
|
+
(modal_y..(modal_y + modal_height)).each do |y|
|
|
54
|
+
setpos(y, modal_x)
|
|
55
|
+
attron(color_pair(3)) do
|
|
56
|
+
addstr(' ' * modal_width)
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
setpos(modal_y, modal_x)
|
|
61
|
+
attron(color_pair(4) | Curses::A_BOLD) do
|
|
62
|
+
addstr("\u250C#{'─' * (modal_width - 2)}\u2510")
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
setpos(modal_y + 1, modal_x)
|
|
66
|
+
attron(color_pair(4) | Curses::A_BOLD) do
|
|
67
|
+
addstr('│')
|
|
68
|
+
end
|
|
69
|
+
attron(color_pair(5) | Curses::A_BOLD) do
|
|
70
|
+
addstr(' Key Mappings '.center(modal_width - 2))
|
|
71
|
+
end
|
|
72
|
+
attron(color_pair(4) | Curses::A_BOLD) do
|
|
73
|
+
addstr('│')
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
setpos(modal_y + 2, modal_x)
|
|
77
|
+
attron(color_pair(4)) do
|
|
78
|
+
addstr("\u251C#{'─' * (modal_width - 2)}\u2524")
|
|
79
|
+
end
|
|
80
|
+
|
|
78
81
|
help_lines.each_with_index do |line, idx|
|
|
79
82
|
break if idx >= modal_height - 4 # Stop if we run out of vertical space
|
|
80
83
|
|
data/lib/sergeant/version.rb
CHANGED