rubyterm 0.2.5 → 0.2.7
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/lib/rubyterm/app.rb +23 -1
- data/lib/rubyterm/version.rb +1 -1
- data/lib/trackchanges.rb +4 -0
- data/lib/windowadapter.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3ddbf4d21fc1c56952d43421b3fdb23b68a7bf987769c3e01ee1e736ed597872
|
|
4
|
+
data.tar.gz: 5e385e0a98361a06069f5937655e037a438ae0064fdf845e4f384883a53e6117
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1d13beb2c8169a361ef35f49334e50cba685b7d7f9fab84b62d3a32f56b2d0a534ec3696d495639d9c1aaedb38cff5c9cd3b9850d0fafd9fdff5d21ccbc93634
|
|
7
|
+
data.tar.gz: 6337a2248a5c62f7d7a74bf4b69dbc0c5354b9dd9ec336b9300dfb7fdc0be158da68f275e01f6f14aff607bc509333e98fc858b3e74c6d155d04f605dee754ad
|
data/lib/rubyterm/app.rb
CHANGED
|
@@ -420,6 +420,25 @@ class RubyTerm
|
|
|
420
420
|
@buffer.draw_flush
|
|
421
421
|
end
|
|
422
422
|
|
|
423
|
+
# A line of the scroll region [start..bottom] has scrolled up into
|
|
424
|
+
# history. The selection is stored in *buffer* coordinates (negative rows
|
|
425
|
+
# = scrollback), so the content the user selected now sits one row higher:
|
|
426
|
+
# cells inside the scrolled region - and anything already in scrollback,
|
|
427
|
+
# whose negative index shifts as the history grows - move up by one, while
|
|
428
|
+
# content below the region stays put. Shift the stored selection to match
|
|
429
|
+
# so reapply_selection keeps the highlight pinned to the same text as it
|
|
430
|
+
# scrolls (into scrollback and back), instead of leaving it on whatever
|
|
431
|
+
# rolls into the old screen rows. Called from TrackChanges#scroll_up via
|
|
432
|
+
# the adapter for every line moved into history.
|
|
433
|
+
def shift_selection_for_scroll(start, bottom)
|
|
434
|
+
return unless @select_startpos
|
|
435
|
+
[@select_startpos, @select_endpos].each do |pos|
|
|
436
|
+
next unless pos
|
|
437
|
+
y = pos[1]
|
|
438
|
+
pos[1] -= 1 if y < 0 || (y >= start && y <= bottom)
|
|
439
|
+
end
|
|
440
|
+
end
|
|
441
|
+
|
|
423
442
|
# FIXME: Cursor, selection etc. are "special" overlays on top of attributes.
|
|
424
443
|
# Allow the terminal to set a set of positions + fg/bg, and a set of ranges.
|
|
425
444
|
def render_selection
|
|
@@ -516,9 +535,12 @@ class RubyTerm
|
|
|
516
535
|
clear_selection_if_set
|
|
517
536
|
end
|
|
518
537
|
end
|
|
519
|
-
when :vt200, :btn_event
|
|
538
|
+
when :vt200, :btn_event, :any_event
|
|
520
539
|
# FIXME: This is only right for @mouse_reporting == :digits
|
|
521
540
|
# FIXME: Report modifiers.
|
|
541
|
+
# FIXME: Motion reporting is the same for all three modes; strictly
|
|
542
|
+
# :vt200 (1000) reports no motion and :any_event (1003) reports all
|
|
543
|
+
# motion, not just with a button held.
|
|
522
544
|
# Not reporting release for scroll wheel
|
|
523
545
|
return if release && button >= 4
|
|
524
546
|
event = [0,1,2,64,65][button-1]
|
data/lib/rubyterm/version.rb
CHANGED
data/lib/trackchanges.rb
CHANGED
|
@@ -69,6 +69,10 @@ class TrackChanges
|
|
|
69
69
|
start = @buffer.scroll_start.to_i
|
|
70
70
|
bottom = @buffer.scroll_end || (@rows - 1)
|
|
71
71
|
@buffer.scroll_up
|
|
72
|
+
# The content moved up in the buffer; keep any active text selection
|
|
73
|
+
# pinned to it. Done before the @suspend bail-out so the selection stays
|
|
74
|
+
# aligned even through jump-scrolled (unrendered) frames.
|
|
75
|
+
@adapter.scroll_selection(start, bottom)
|
|
72
76
|
return if @suspend
|
|
73
77
|
if @adapter.scrollback_mode
|
|
74
78
|
@adapter.scrollback_anchor
|
data/lib/windowadapter.rb
CHANGED
|
@@ -30,6 +30,14 @@ class WindowAdapter
|
|
|
30
30
|
# offset instead of letting the viewport drift.
|
|
31
31
|
def scrollback_anchor = @window.scrollback_anchor
|
|
32
32
|
|
|
33
|
+
# A line of the scroll region [start..bottom] has moved into history.
|
|
34
|
+
# Forward to the orchestrator so it can keep a live text selection pinned
|
|
35
|
+
# to the content it covers. The headless harness/bench hosts have no
|
|
36
|
+
# selection state and do not implement this, so it no-ops there.
|
|
37
|
+
def scroll_selection(start, bottom)
|
|
38
|
+
@term.shift_selection_for_scroll(start, bottom) if @term.respond_to?(:shift_selection_for_scroll)
|
|
39
|
+
end
|
|
40
|
+
|
|
33
41
|
# DECCOLM: the terminal asked to switch to +cols+ columns (80/132). The
|
|
34
42
|
# orchestrator (RubyTerm) owns the window pixels, font scale, config and
|
|
35
43
|
# the pty size report, so delegate to it. The headless harness "term"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rubyterm
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vidar Hokstad
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-07-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: pure-x11
|