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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0ac7149617ce3dd0a2e0c767ff46f6d2627fe917383303835f40a37461097dd8
4
- data.tar.gz: 3d5621c41d6eec97194f62cab6ed525e1e1dd826fc9ed3fce3f9a08d67fba52a
3
+ metadata.gz: 41cc1fef750cecd3e0a9a530976e8818955bc0db86a434319420dbe250496405
4
+ data.tar.gz: 60db0f330203e559828d1cc87f701af503d174a6577bc351bfcc2fce2dc88752
5
5
  SHA512:
6
- metadata.gz: 1168b03a1a86233bebd92e7b287d10e33264e4d80b025bb06087b48a2560fa3f8f6c1c35e16634eedf64a7a60e723a01fb0755481ad7f32e9748a871a9be5639
7
- data.tar.gz: 4111f86ea5fc31114d1e6a691bebf3e3a21beb4b1de6b4e26a1d34d11825c895ff3e3acdf568d5e1c818838402f06709e3bf715d12687725b1d9ea6530d4da9d
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
@@ -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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sergeant
4
- VERSION = '1.0.9'
4
+ VERSION = '1.0.10'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sergeant
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 1.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mateusz Grotha