typr 1.9.2 → 1.9.3

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: 5c61c73e0ce9201962acda993655743ab611ae86a2a3102d64dd05bacb223751
4
- data.tar.gz: d0474937ff2a6ad8cb5eb39918eac2302d7114998e9e6775a99f6b52a1727b13
3
+ metadata.gz: cdabc3f928eb42904b0f1cd0778384bca290ae56dfbb050236cda6a6578d19e8
4
+ data.tar.gz: 236970a28d8cd9265651985504a60a8113cdfaf2b8378303388c0a9e4883469e
5
5
  SHA512:
6
- metadata.gz: 76773590e95c2693fdc3df40a9020a07f5817357748cb9aca13490d26deb27c8d07c54815b4a8e118ea562e1167672edfea312ed4f3b372e2cc4be00edfa0845
7
- data.tar.gz: 3452ef2e2b11a67f19ffbca386ebac9c3abddd730db58c5dd09038edbafbc528c04fcf13042fef4339ce3edb7a2af62b8be99a673d98ecfd4be3b63886c07c1c
6
+ metadata.gz: 82420afecbc67164d9271e315cd571f33898f4f4ae4ee4186da231cbb6d461df5714180e47c6237d7a54224fd0742777084d44c38e221931f763418bdc19df7d
7
+ data.tar.gz: cafd2cf36cdbf58e70249042e7952ca1048325b61ae404b0c4a154eabcb9684cbe8bf75b3aaee239d0c169da7057826a1b7e1bcae1e6dd2b81fa9145942424d9
data/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ## [vx.y.z] — __DATE__
4
4
 
5
+ ## [v1.9.3] — 2026-10-19
6
+
7
+ ### Fixed
8
+ - Grid rendering can no longer crash with `ArgumentError: negative argument` on emoji-wide cell text — the pad in `prepare` is clamped at zero, and `clip` measures grapheme clusters (flags, `‼️`-style presentation sequences) instead of single chars so its width accounting matches `real_size`
9
+ - Numeric hints no longer vanish when the list shrinks below the Tab-cycled hint offset (after a `move`/transfer or `cd` into a smaller directory) — `show` re-clamps `hints_start` so the existing single redraw shows the digits again without any extra drawing
10
+ - A one-entry filtered pick auto-returns before the popup is drawn — `Grid#pick` checks the initial match set before showing, so a single-entry grid returns its entry without ever displaying
11
+ - The `text` example wires `regex: :generic` colors into its Text widget, so regex highlighting is demonstrated out of the box
12
+
5
13
  ## [v1.9.2] — 2026-10-13
6
14
 
7
15
  ### Fixed
data/example/text CHANGED
@@ -33,7 +33,7 @@ class TextTest
33
33
  input: $<, header: "Text Area Header",
34
34
  top: 2, left: 0.1, right: 0.9, bottom: -4,
35
35
  border: :round, borders:{ left: ?┆, right: ?┆, top: ?╌, bottom: ?╌ },
36
- colors: { header: [:yellow, :grey30], hints: [:black, :white] }
36
+ colors: { header: [:yellow, :grey30], hints: [:black, :white], regex: :generic }
37
37
  )
38
38
  @user = Line.new( top: -1,
39
39
  default: "[/]:search [n]ext [p]rev, pick [r]ow/[R]ows, [w]ord/[W]ords, [esc] quit",
data/lib/grid.rb CHANGED
@@ -329,6 +329,7 @@ module Typr
329
329
  @filters = [[column, '']]
330
330
  @map = base.select{ |id| check id }
331
331
  @start = 0
332
+ return @map.first if auto and @map.one?
332
333
  @bottom ||= bottom
333
334
  show
334
335
  draw_hints
data/lib/stack.rb CHANGED
@@ -149,6 +149,7 @@ module Typr
149
149
  mode :reset
150
150
  end
151
151
  list = page.to_a
152
+ @hints_start = 0 if @hints_start > [height-1, rows-1+headspace].min
152
153
  list[ height-1 ] = nil if list.length < height
153
154
  for id, relative_id in list.each_with_index
154
155
  move left,top + relative_id + headspace
data/lib/terminal.rb CHANGED
@@ -147,7 +147,7 @@ module Typr
147
147
 
148
148
  def prepare str, max, align=:left, side=:right
149
149
  str = clip str, max, side if real_size(str) >= max
150
- pad = " " * (max - real_size(str))
150
+ pad = " " * [max - real_size(str), 0].max
151
151
  align == :right ? pad + str : str + pad
152
152
  end
153
153
 
@@ -185,14 +185,14 @@ module Typr
185
185
  used += size
186
186
  elsif used < max
187
187
  need = max - used
188
- chars = token.chars
189
- chars.reverse! if side == :left
188
+ clusters = token.grapheme_clusters
189
+ clusters.reverse! if side == :left
190
190
  width = 0
191
191
  out = ""
192
- chars.each do |char|
193
- width += Unicode::DisplayWidth.of char
192
+ clusters.each do |cluster|
193
+ width += Unicode::DisplayWidth.of cluster
194
194
  break if width > need
195
- out << char
195
+ out << cluster
196
196
  end
197
197
  out.reverse! if side == :left
198
198
  kept << out
data/typr.gemspec CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "typr"
5
- s.version = "1.9.2"
6
- s.date = "2026-10-13"
5
+ s.version = "1.9.3"
6
+ s.date = "2026-10-19"
7
7
  s.homepage = "https://codeberg.org/typr/typr"
8
8
  s.licenses = ["MIT"]
9
9
  s.require_paths = ["lib"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: typr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.2
4
+ version: 1.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kilian Reitmayr
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2026-10-13 00:00:00.000000000 Z
10
+ date: 2026-10-19 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: unicode-display_width