rcurses 2.5 → 2.6.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/README.md +2 -0
- data/lib/rcurses/pane.rb +14 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aed95a107616226e2f90aaf5db3dbfd3cddfbb905254e31115857d882741fa61
|
4
|
+
data.tar.gz: ba178a044ed384e5bc3c2c53af77cc654eb96977316e1464f3b0be3e8c35694f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1af985cfb5ecb496bcf321a4429c8b038528c8ba46191eae4e4304746e0ca61a517268342dbf4293f004553e57222f95e96fc67c78710d605ad33a57a0cfcb14
|
7
|
+
data.tar.gz: 3e8232f1023544530e6728a5a1be196764e0296765eb5d3639b63b34fd645b592a49a3efcc0109dcda6597a35e5f280337a6c6e08d3602cfd588e90c39938de0
|
data/README.md
CHANGED
@@ -81,6 +81,8 @@ edit | An editor for the Pane. When this is invoked, all existing font
|
|
81
81
|
editline | Used for one-line Panes. It will print the content of the property `prompt` and then the property `text` that can then be edited by the user. Hitting `ESC` will disregard the edits, while `ENTER` will save the edited text
|
82
82
|
puts(text) | Short form for setting panel.text, then doing a refresh of that panel
|
83
83
|
ask(prompt,text) | Short form of setting panel.prompt, then panel.text, doing a panel.editline and then returning panel.text
|
84
|
+
pagedown | Go down one page height in the text (minus one line), but not longer than the length of the text
|
85
|
+
pageup | Go up one page height in the text (minus one line)
|
84
86
|
|
85
87
|
# class String extensions
|
86
88
|
Method extensions provided for the class String:
|
data/lib/rcurses/pane.rb
CHANGED
@@ -35,6 +35,19 @@ module Rcurses
|
|
35
35
|
|
36
36
|
def puts(text)
|
37
37
|
@text = text
|
38
|
+
@ix = 0
|
39
|
+
refresh
|
40
|
+
end
|
41
|
+
|
42
|
+
def pageup
|
43
|
+
@ix = @ix - @h + 1
|
44
|
+
@ix = 0 if @ix < 0
|
45
|
+
refresh
|
46
|
+
end
|
47
|
+
|
48
|
+
def pagedown
|
49
|
+
@ix = @ix + @h - 1
|
50
|
+
@ix = @text.length - 1 if @ix > @text.length - 1
|
38
51
|
refresh
|
39
52
|
end
|
40
53
|
|
@@ -411,6 +424,7 @@ module Rcurses
|
|
411
424
|
@y = [[@y, 1].max, @max_h - @h + 1].min
|
412
425
|
|
413
426
|
@scroll = false
|
427
|
+
@ix = 0
|
414
428
|
row(@y)
|
415
429
|
|
416
430
|
fmt = [@fg, @bg].compact.join(',')
|
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:
|
4
|
+
version: 2.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geir Isene
|
@@ -29,8 +29,9 @@ description: 'Create curses applications for the terminal easier than ever. Crea
|
|
29
29
|
up text (in panes or anywhere in the terminal) in bold, italic, underline, reverse
|
30
30
|
color, blink and in any 256 terminal colors for foreground and background. Use a
|
31
31
|
simple editor to let users edit text in panes. Left, right or center align text
|
32
|
-
in panes. Cursor movement around the terminal. New in 2.
|
33
|
-
|
32
|
+
in panes. Cursor movement around the terminal. New in 2.6: Added methods ''pagedown''
|
33
|
+
and ''pageup'' to panes enabling text scrolling. 2.6.1: Resetting index ''ix'' to
|
34
|
+
0 on pane methods ''puts'' and ''editline''.'
|
34
35
|
email: g@isene.com
|
35
36
|
executables: []
|
36
37
|
extensions: []
|