typr 1.5.0 → 1.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6f464a51f6c8356a1571fcebe51bbe315428ec054d9b1b819753a688764ce347
4
- data.tar.gz: '0367917e4ce7b2f67c0605bb321f358aa81e17f27ab555ab558a6655b646dc9a'
3
+ metadata.gz: f04e1f9234a97079a70786d6a427c7c6394775515c78a19feee8e17e3dc1370e
4
+ data.tar.gz: b82771f5976e12fabbd56446d347ac8f49739e41d4dbe089b7ffc5738938dd17
5
5
  SHA512:
6
- metadata.gz: 6f3f59d78bfc8831542c843de4eb51aa1507774b95436f97d9cf906f12945808f25c1add663945ad3d94ba8f33a543bc8f2cb960eac2adf995e6c6ec62fb715e
7
- data.tar.gz: bf0a175749a29714fa07e0e8124b72a031dd9606c7d077cdcf7f214dc81783d28a2cce6b0e265afbbee9155a82cef742916c0a4956522c3edf56b66b6c223bbd
6
+ metadata.gz: 99278addeb2d176281564448ddb5b34de23aebb1bac5a3e186c0a4735aafad0387274100bd38fa33018988d7672a7959c6c9791fd2bb8bf50c2e2545075552c6
7
+ data.tar.gz: 9efd4720c0cc7c58f41acf31ca8a38827300127b72ffadaf9d18ebd53b8be0500f53de1386eed6255149f858ab3e5a943523ba79630cadf11eddf8c0f8a6e072
data/CHANGELOG.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Changelog
2
2
 
3
+ ## [v1.5.1] — 2026-09-11
4
+
3
5
  ## [v1.5.0] — 2026-09-05
4
6
 
5
7
  ### Added
@@ -21,6 +23,8 @@
21
23
  - `Text#build` wraps ANSI-colored content correctly — the capacity calculation uses display width instead of byte length, so escape sequences don't inflate the line count
22
24
  - `reset_view` reloads the directory again — it calls `cd @directory` before clearing display/selection/position and re-sorting, so reset picks up new and removed files instead of only reshuffling the stale listing
23
25
  - Head path lookup — `@head.path_at(x, y)` maps a click to a target directory: the username column returns the resolved home directory, each `/`-separated segment of the directory cell returns that ancestor path (padding, action columns and array listings return nil); mouse `x` is adjusted from 1-based terminal columns so boundary clicks resolve to the cell under the cursor
26
+ - `Mouse#alt?` — reports the SGRmeta bit, so callers can treat Alt+click like a right-click (e.g. opening a command list where right-click is hard to send, as on Termux touchscreens)
27
+ - `cd` survives unreadable directories — `chdir` and the listing are probed before any state changes, so `EACCES`/`ENOENT` (e.g. Android's `/data`) shows a warning and stays put instead of crashing on an emptied listing; returns `false` on failure
24
28
 
25
29
  ## [v1.4.0] — 2026-08-15
26
30
 
data/lib/browser.rb CHANGED
@@ -58,11 +58,22 @@ module Typr
58
58
  return unless dir
59
59
  data, missing = [],{}
60
60
  unless append
61
+ begin
62
+ path = File.expand_path( dir )
63
+ Dir.chdir( path )
64
+ entries = Dir.new( path ).children
65
+ rescue SystemCallError
66
+ @user.show "cannot open directory: #{dir}"
67
+ Typr.read_key
68
+ return false
69
+ end
61
70
  @colors[:fields] = {}
62
71
  clear
63
- Dir.chdir( @directory = File.expand_path( dir ) )
72
+ @directory = path
73
+ else
74
+ entries = Dir.new( @directory ).children
64
75
  end
65
- data = Dir.new(@directory).children.reject{|f|
76
+ data = entries.reject{|f|
66
77
  !@show_hidden and f[0] == ?. }.map { |file| scan_file file }
67
78
 
68
79
  data.each_with_index{ |row, id|
data/lib/terminal.rb CHANGED
@@ -76,6 +76,7 @@ module Typr
76
76
  def left?; button == 0 end
77
77
  def middle?; button == 1 end
78
78
  def right?; button == 2 end
79
+ def alt?; ( modifiers & 8 ) != 0 end
79
80
  def to_s; "%s button=%i x=%i y=%i%s" % [ action, button, x, y,
80
81
  ( modifiers > 0 ? " modifiers=#{modifiers}" : "" ) ] end
81
82
  end
data/typr.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "typr"
5
- s.version = "1.5.0"
5
+ s.version = "1.5.1"
6
6
  s.date = "2026-07-25"
7
7
  s.homepage = "https://codeberg.org/typr/typr"
8
8
  s.licenses = ["MIT"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: typr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kilian Reitmayr