marvi 0.8.0 → 0.8.1
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 +4 -0
- data/lib/marvi/renderer/curses/tab_bar.rb +6 -0
- data/lib/marvi/renderer/curses.rb +10 -3
- data/lib/marvi/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: ce10cf349eaa081b2f4fc1f2f9c038fd62c7e3aaa5f01ed782e03e6a05a93e8c
|
|
4
|
+
data.tar.gz: 7e4c20a1f8f53dd60e21ed27ad3f95ae08f5be365e6eda5fba514fb947b25f0e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e6ebac4779d6b0d88b3473d26d9455322cd0680defe3c94e7784dc6506c23173d4dc8236be67f28ff8feae4b25f9526b3a53502decb8a16e107285414cf4b4f3
|
|
7
|
+
data.tar.gz: bf8467ba67c1f3ff3cd87c02cb577492c76ff36ff8b67efbc89e5e9cd219f5388175ced544043008ea1d4bf1b2f1e3c94cc20f9473ec8f9377e6798e4e63aae7
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.8.1] - 2026-07-07
|
|
4
|
+
|
|
5
|
+
- Add a blank margin row between the tab bar and the document. Clicks on the margin row select the tab directly above it, giving each tab a taller effective click target.
|
|
6
|
+
|
|
3
7
|
## [0.8.0] - 2026-07-06
|
|
4
8
|
|
|
5
9
|
- Turn the `o` prompt into a file picker. It lists Markdown/text documents under the current directory and narrows the list as you type (all space-separated terms must match, case-insensitive); select with `C-n`/`C-p` or the arrow keys and open with `Enter`. Input starting with `/`, `~`, `./`, or `../` switches to explicit path entry with shell-style `Tab` completion, and selecting a directory descends into it.
|
|
@@ -42,6 +42,12 @@ module Marvi
|
|
|
42
42
|
items.find { |item| item.contains?(y, x) }
|
|
43
43
|
end
|
|
44
44
|
|
|
45
|
+
# Resolve a click including the margin row directly below the bar,
|
|
46
|
+
# which is attributed to the tab above it — a taller click target.
|
|
47
|
+
def item_for_click(items, y, x)
|
|
48
|
+
item_at(items, y, x) || ((y == rows(items)) ? item_at(items, y - 1, x) : nil)
|
|
49
|
+
end
|
|
50
|
+
|
|
45
51
|
def truncate_to_width(text, max_width)
|
|
46
52
|
return text if Unicode::DisplayWidth.of(text) <= max_width
|
|
47
53
|
|
|
@@ -32,6 +32,11 @@ module Marvi
|
|
|
32
32
|
MIN_HORIZONTAL_PADDING = 2
|
|
33
33
|
HORIZONTAL_PADDING_DIVISOR = 12
|
|
34
34
|
|
|
35
|
+
# Blank row between the tab bar and the document. Clicks landing on it
|
|
36
|
+
# are attributed to the tab directly above, giving each tab a taller
|
|
37
|
+
# effective click target than the single character cell.
|
|
38
|
+
TAB_BAR_MARGIN_ROWS = 1
|
|
39
|
+
|
|
35
40
|
def render(markdown, file: nil)
|
|
36
41
|
run([Tab.new(file: file, markdown: markdown)])
|
|
37
42
|
end
|
|
@@ -211,7 +216,7 @@ module Marvi
|
|
|
211
216
|
return unless event
|
|
212
217
|
return if (event.bstate & (::Curses::BUTTON1_CLICKED | ::Curses::BUTTON1_PRESSED)).zero?
|
|
213
218
|
|
|
214
|
-
item = TabBar.
|
|
219
|
+
item = TabBar.item_for_click(tab_layout, event.y, event.x)
|
|
215
220
|
switch_to(item.index) if item
|
|
216
221
|
end
|
|
217
222
|
|
|
@@ -228,7 +233,8 @@ module Marvi
|
|
|
228
233
|
end
|
|
229
234
|
|
|
230
235
|
def tab_bar_height
|
|
231
|
-
TabBar.rows(tab_layout)
|
|
236
|
+
rows = TabBar.rows(tab_layout)
|
|
237
|
+
rows.zero? ? 0 : rows + TAB_BAR_MARGIN_ROWS
|
|
232
238
|
end
|
|
233
239
|
|
|
234
240
|
def draw_tab_bar(layout)
|
|
@@ -313,7 +319,8 @@ module Marvi
|
|
|
313
319
|
::Curses.clear
|
|
314
320
|
layout = tab_layout
|
|
315
321
|
draw_tab_bar(layout)
|
|
316
|
-
|
|
322
|
+
bar_rows = TabBar.rows(layout)
|
|
323
|
+
offset = bar_rows.zero? ? 0 : bar_rows + TAB_BAR_MARGIN_ROWS
|
|
317
324
|
tab = current_tab
|
|
318
325
|
tab.clamp_scroll(page_size)
|
|
319
326
|
padding = horizontal_padding
|
data/lib/marvi/version.rb
CHANGED