rcurses 6.0.0 → 6.0.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rcurses/pane.rb +10 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a5b3327d242e4e2b4644033802a3acf428683be84817eeaadb6660e81c8ecbc6
4
- data.tar.gz: b0b8a0b6c96d949bb82c61db5a328294c85b58d16f40039161cdb9c313edc54b
3
+ metadata.gz: 53036cc4649face7e14b08f311890f1ccd0e09acd6f65f15a797578b4184d7ac
4
+ data.tar.gz: eef69f7e651ef3d62bd7f68d42a92d166267ef67fcef5a6e20753ecd1a95acb9
5
5
  SHA512:
6
- metadata.gz: 75ada84fd5db957fb04f494ebc2d9db4ae0bbf3930d70a47edbf8330102e10c45b116d8dc2255908babb8eb0ce5c362801eaff294054c66fb397dd31fbcb34cf
7
- data.tar.gz: 264a82852322b446424bf9572ba992afe1981bd036b5a80c9341e10efcfd810badbcede9c4703403b6d931c589b507d5df898f2fcf41f6edf6533d550a16c608
6
+ metadata.gz: a28c4b75f14b35c4fc92d2c26d7fc214db22944c59d185d44c89f32ecc8078593d5a84d9082b96d968e1b4156341fd8790ce95f2c3b478ecd8b8318054047763
7
+ data.tar.gz: 31df11786aa48deda46a57917f2ce586f93ff6db27e7ee118fd52fbe42c5c57c69f5c8cb69852163fd0991fcd060c0728dc7e810980db8d51272e2d650aa5383
data/lib/rcurses/pane.rb CHANGED
@@ -223,10 +223,17 @@ module Rcurses
223
223
 
224
224
  content_rows = @h
225
225
  # Ensure we have processed enough lines for the current scroll position + visible area.
226
- required_lines = @ix + content_rows + 50 # Buffer a bit for smoother scrolling
227
- max_cache_size = 1000 # Prevent excessive memory usage
226
+ # Dynamically process more lines as needed when scrolling through large lists
227
+ required_lines = @ix + content_rows + 100 # Larger buffer for smoother scrolling
228
228
 
229
- while @lazy_txt.size < required_lines && @lazy_index < @raw_txt.size && @lazy_txt.size < max_cache_size
229
+ # Safety limit to prevent excessive memory usage (but still very generous)
230
+ max_allowed = 100000 # Allow up to 100k lines which should handle any reasonable directory
231
+
232
+ # Process lines on demand as we scroll
233
+ while @lazy_txt.size < required_lines && @lazy_index < @raw_txt.size
234
+ # Safety check to prevent runaway memory usage
235
+ break if @lazy_txt.size > max_allowed
236
+
230
237
  raw_line = @raw_txt[@lazy_index]
231
238
  # If the raw line is short, no wrapping is needed.
232
239
  if raw_line.respond_to?(:pure) && Rcurses.display_width(raw_line.pure) < @w
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rcurses
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0
4
+ version: 6.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene