rcurses 6.1.7 → 6.1.8

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -0
  3. data/lib/rcurses/pane.rb +5 -3
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c6cd88e7945b9df842bb148be5d71b6e04bf912bbe16ab676bab21b940479ce
4
- data.tar.gz: 71bc49050001d78f38f2d749c74c2648c9278ccf7dc5b33f576a9d4f4b3ab639
3
+ metadata.gz: 72260982576477690897f35d9b879ec6ebe2ce96d8ed9890eb17f4a450a3761a
4
+ data.tar.gz: ede3452eb593c4a15d86a1305aa58f672fc60a8247f31788d6cc406c93cfa73c
5
5
  SHA512:
6
- metadata.gz: 7c6f5962a5ae1899560583246982bdaea68191fa9c71dde9e1b51c57b641dfd3a4e39aacaedbb4e7df6e97b460189abac7cda426f32fc57d0d03c9d737d28acf
7
- data.tar.gz: d88ded84e69538f801f6e01f32fcfd4a664b05df2ee01cd92868b399228bc034c0883b822e34c0ad6ccf652bfe4fa7ab41213f7c4628048862dfed3c45443a89
6
+ metadata.gz: '0686e0adcbe24f0ad7a5c3d0a5655e0edacb93aa7b6f46e71bc5665000379d8a7529d5d15ed79c1d3afb7e0d2e567c93c235fe116b1dcfadc4fb397bfb7b0360'
7
+ data.tar.gz: 1657bc094efdef6af6665aec14a77d98b9b56b02eb4a6bcbdd10cfb816dfaacfc9a4b8c57f77eba0208c6df5c30909e589a52df0eeb03bff34beb3d7324bd748
data/README.md CHANGED
@@ -88,6 +88,7 @@ fg | Foreground color for the Pane
88
88
  bg | Background color for the Pane
89
89
  border | Draw border around the Pane (=true) or not (=false), default being false
90
90
  scroll | Whether to indicate more text to be shown above/below the Pane, default is true
91
+ scroll_fg | Color for scroll indicators (∆/∇), defaults to pane fg color if nil
91
92
  text | The text/content of the Pane
92
93
  ix | The line number at the top of the Pane, starts at 0, the first line of text in the Pane
93
94
  index | An attribute that can be used to track the selected line/element in the pane
@@ -404,6 +405,11 @@ And - try running the example file `rcurses_example.rb`.
404
405
 
405
406
  # Version History
406
407
 
408
+ ## v6.1.8
409
+ - Added `scroll_fg` pane attribute for custom scroll indicator (∆/∇) color
410
+ - When set, scroll markers use this color instead of the pane's foreground color
411
+ - Defaults to nil (existing behavior unchanged)
412
+
407
413
  ## v5.1.2 (2025-08-13)
408
414
  - Added comprehensive scrolling best practices documentation (SCROLLING_BEST_PRACTICES.md)
409
415
  - Documentation improvements for developers implementing scrollable panes
data/lib/rcurses/pane.rb CHANGED
@@ -3,7 +3,7 @@ module Rcurses
3
3
  require 'clipboard' # Ensure the 'clipboard' gem is installed
4
4
  include Cursor
5
5
  include Input
6
- attr_accessor :x, :y, :w, :h, :fg, :bg
6
+ attr_accessor :x, :y, :w, :h, :fg, :bg, :scroll_fg
7
7
  attr_accessor :border, :scroll, :text, :ix, :index, :align, :prompt
8
8
  attr_accessor :moreup, :moredown
9
9
  attr_accessor :record, :history
@@ -27,6 +27,7 @@ module Rcurses
27
27
  @record = false # Don't record history unless explicitly set to true
28
28
  @history = [] # History array
29
29
  @max_history_size = 100 # Limit history to prevent memory leaks
30
+ @scroll_fg = nil # Scroll indicator color (defaults to @fg)
30
31
  @multiline_buffer = [] # Buffer to store lines from multi-line paste
31
32
 
32
33
  ObjectSpace.define_finalizer(self, self.class.finalizer_proc)
@@ -366,13 +367,14 @@ module Rcurses
366
367
  # Draw scroll markers after printing the frame.
367
368
  if @scroll
368
369
  marker_col = @x + @w - 1
370
+ sfmt = @scroll_fg ? [(@scroll_fg).to_s, @bg.to_s].join(',') : fmt
369
371
  if @ix > 0
370
- print "\e[#{@y};#{marker_col}H" + "∆".c(fmt)
372
+ print "\e[#{@y};#{marker_col}H" + "∆".c(sfmt)
371
373
  end
372
374
  # If there are more processed lines than fit in the pane
373
375
  # OR there remain raw lines to process, show the down marker.
374
376
  if (@txt.length - @ix) > @h || (@lazy_index < @raw_txt.size)
375
- print "\e[#{@y + @h - 1};#{marker_col}H" + "∇".c(fmt)
377
+ print "\e[#{@y + @h - 1};#{marker_col}H" + "∇".c(sfmt)
376
378
  end
377
379
  end
378
380
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rcurses
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.7
4
+ version: 6.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-02-24 00:00:00.000000000 Z
11
+ date: 2026-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clipboard