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.
- checksums.yaml +4 -4
- data/lib/rcurses/pane.rb +10 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53036cc4649face7e14b08f311890f1ccd0e09acd6f65f15a797578b4184d7ac
|
4
|
+
data.tar.gz: eef69f7e651ef3d62bd7f68d42a92d166267ef67fcef5a6e20753ecd1a95acb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
227
|
-
|
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
|
-
|
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
|