rcurses 2.6 → 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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -2
  3. data/lib/rcurses/pane.rb +13 -1
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 85c679d06754d9afd2c33e55e44d700d37333f197ffb1d753ef3ff8bbdf15e1b
4
- data.tar.gz: 5f2c74a5a789c93c6406bb761fffc769d13ab8e0723b743f408e264cfd61614a
3
+ metadata.gz: b690f977339cf36287c04aa4b7cf7b06c3d917ac43149d80218c38d04aec02e5
4
+ data.tar.gz: 2e36b22211f5ea26f7fe1fd08092a33e2373d4e811eede99dd09a3e55deca5f5
5
5
  SHA512:
6
- metadata.gz: 19854a5865cfe09fcdcad1c8e9540ac5eb29a704f1b8e0b9626e6c69e8b51f5991411ea5f60bf8f9eb6a67725b89f3c3debfe2fc0af0857e3a770e103603ffae
7
- data.tar.gz: 22f2e416110f65bdedad83a967464d6072affa79b45facf5c38abf3ae80cbe22ec1a0d2041c57f295082e98a0529994f4b8c352443e578853a27792009a02f18
6
+ metadata.gz: 811a2f83630b5e570c6bab2bf0d635fef7a5a3ae524bc9f97dbf6a3c3f3f77abdbe8db988ddf35b7cc664322783453df16d974b179b5bc976a0499e4fcc3cf80
7
+ data.tar.gz: 9960da711a664264ff48ec7f7dafdc40e68e190bb265bfd12e1c94b0b94a0b2607de04758f5993b53f4732c4804c9f925eabf6e8a5a0b88b16f0814a6222849c
data/README.md CHANGED
@@ -81,8 +81,10 @@ 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
+ pagedown | Scroll down one page height in the text (minus one line), but not longer than the length of the text
85
+ pageup | Scroll up one page height in the text (minus one line)
86
+ bottom | Scroll to the bottom of the text in the pane
87
+ top | Scroll to the top of the text in the pane
86
88
 
87
89
  # class String extensions
88
90
  Method extensions provided for the class String:
data/lib/rcurses/pane.rb CHANGED
@@ -35,6 +35,7 @@ module Rcurses
35
35
 
36
36
  def puts(text)
37
37
  @text = text
38
+ @ix = 0
38
39
  refresh
39
40
  end
40
41
 
@@ -46,7 +47,17 @@ module Rcurses
46
47
 
47
48
  def pagedown
48
49
  @ix = @ix + @h - 1
49
- @ix = @text.length - 1 if @ix > @text.length - 1
50
+ @ix = @text.split("\n").length - @h if @ix > @text.split("\n").length - @h
51
+ refresh
52
+ end
53
+
54
+ def top
55
+ @ix = 0
56
+ refresh
57
+ end
58
+
59
+ def bottom
60
+ @ix = @text.split("\n").length - @h
50
61
  refresh
51
62
  end
52
63
 
@@ -423,6 +434,7 @@ module Rcurses
423
434
  @y = [[@y, 1].max, @max_h - @h + 1].min
424
435
 
425
436
  @scroll = false
437
+ @ix = 0
426
438
  row(@y)
427
439
 
428
440
  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: '2.6'
4
+ version: '2.7'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
@@ -29,8 +29,8 @@ 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.6: Added methods ''pagedown''
33
- and ''pageup'' to panes enabling text scrolling.'
32
+ in panes. Cursor movement around the terminal. New in 2.7: Added pane methods ''top''
33
+ and ''bottom'' for text scrolling in pane.'
34
34
  email: g@isene.com
35
35
  executables: []
36
36
  extensions: []