rcurses 2.4 → 2.4.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 +3 -2
- data/lib/rcurses/cursor.rb +18 -17
- data/lib/rcurses/input.rb +3 -1
- data/lib/rcurses/pane.rb +5 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c231359439921bfa6f6da0d36db67cf20daf67054031b64b1362cf17a121f36
|
4
|
+
data.tar.gz: 07af990392aca529a25aec404f3a92db948eb64dddd4811c8b9f6f80adca5d55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3d9d2f610c73f034474376e98aac7c63180e6ad1d224f8a0f57898ede77c37679548845b1d21e68f18aa59d187b64808ea417a3a1821b14a78041f35703c1f8
|
7
|
+
data.tar.gz: 006b678e16cd6108fc615cb87e7d7937d88d1e556407e7258a6e6b68a9d0d911652277b8ece6e08f11e6479527b081d994d486dfcd72d9fed592ef6bb5995803
|
data/README.md
CHANGED
@@ -114,12 +114,13 @@ restore | Restore cursor position
|
|
114
114
|
pos | Query cursor current position (example: `row,col = mycursor.pos`)
|
115
115
|
colget | Query cursor current cursor col/x position (example: `row = mycursor.rowget`)
|
116
116
|
rowget | Query cursor current cursor row/y position (example: `row = mycursor.rowget`)
|
117
|
+
set(c = 1, r = 1) | Set the position of the cursor to row/y,col/x (example: `mycursor.set(row,col)`) (default = top row, first column)
|
118
|
+
col(c = 1) | Cursor moves to the nth position horizontally in the current line (default = first column)
|
119
|
+
row(r = 1) | Cursor moves to the nth position vertically in the current column (default = first/top row)
|
117
120
|
up(n = 1) | Move cursor up by n (default is 1 character up)
|
118
121
|
down(n = 1) | Move cursor down by n (default is 1 character down)
|
119
122
|
left(n = 1) | Move cursor backward by n (default is one character)
|
120
123
|
right(n = 1) | Move cursor forward by n (default is one character)
|
121
|
-
col(n = 1) | Cursor moves to the nth position horizontally in the current line (default = first column)
|
122
|
-
row(n = 1) | Cursor moves to the nth position vertically in the current column (default = first/top row)
|
123
124
|
next_line) | Move cursor down to beginning of next line
|
124
125
|
prev_line) | Move cursor up to beginning of previous line
|
125
126
|
clear_char(n = 1) | Erase n characters from the current cursor position (default is one character)
|
data/lib/rcurses/cursor.rb
CHANGED
@@ -26,22 +26,23 @@ module Rcurses
|
|
26
26
|
_row, col = pos
|
27
27
|
col
|
28
28
|
end
|
29
|
-
def
|
30
|
-
def
|
31
|
-
def
|
32
|
-
def
|
33
|
-
def
|
34
|
-
def
|
35
|
-
def
|
36
|
-
def
|
37
|
-
def
|
38
|
-
def
|
39
|
-
def
|
40
|
-
def
|
41
|
-
def
|
42
|
-
def
|
43
|
-
def
|
44
|
-
def
|
45
|
-
def
|
29
|
+
def set(r = 1, c = 1); print(CSI + "#{r}d"); print(CSI + "#{c}G"); end # Set cursor position to Row, Col (y,x)
|
30
|
+
def up(n = 1); print(CSI + "#{(n)}A"); end # Move cursor up by n
|
31
|
+
def down(n = 1); print(CSI + "#{(n)}B"); end # Move the cursor down by n
|
32
|
+
def left(n = 1); print(CSI + "#{n}D"); end # Move the cursor backward by n
|
33
|
+
def right(n = 1); print(CSI + "#{n}C"); end # Move the cursor forward by n
|
34
|
+
def col(c = 1); print(CSI + "#{c}G"); end # Cursor moves to nth position horizontally in the current line
|
35
|
+
def row(r = 1); print(CSI + "#{r}d"); end # Cursor moves to the nth position vertically in the current column
|
36
|
+
def next_line; print(CSI + 'E' + CSI + "1G"); end # Move cursor down to beginning of next line
|
37
|
+
def prev_line; print(CSI + 'A' + CSI + "1G"); end # Move cursor up to beginning of previous line
|
38
|
+
def clear_char(n = 1); print(CSI + "#{n}X"); end # Erase n characters from the current cursor position
|
39
|
+
def clear_line; print(CSI + '2K' + CSI + "1G"); end # Erase the entire current line and return to beginning of the line
|
40
|
+
def clear_line_before; print(CSI + '1K'); end # Erase from the beginning of the line up to and including the current cursor position.
|
41
|
+
def clear_line_after; print(CSI + '0K'); end # Erase from the current position (inclusive) to the end of the line
|
42
|
+
def clear_screen_down; print(CSI + 'J'); end # Clear screen down from current row
|
43
|
+
def scroll_up; print(ESC + 'M'); end # Scroll display up one line
|
44
|
+
def scroll_down; print(ESC + 'D'); end # Scroll display down one line
|
45
|
+
def hide; print(CSI + '?25l'); end # Scroll display down one line
|
46
|
+
def show; print(CSI + '?25h'); end # Scroll display down one line
|
46
47
|
end
|
47
48
|
end
|
data/lib/rcurses/input.rb
CHANGED
@@ -58,6 +58,8 @@ module Rcurses
|
|
58
58
|
when "\u0005" then chr = "C-E"
|
59
59
|
when "\u0006" then chr = "C-F"
|
60
60
|
when "\u0007" then chr = "C-G"
|
61
|
+
when "\u0008" then chr = "C-H"
|
62
|
+
when "\u000A" then chr = "C-J"
|
61
63
|
when "\u000B" then chr = "C-K"
|
62
64
|
when "\u000C" then chr = "C-L"
|
63
65
|
when "\u000D" then chr = "C-M"
|
@@ -66,6 +68,7 @@ module Rcurses
|
|
66
68
|
when "\u0010" then chr = "C-P"
|
67
69
|
when "\u0011" then chr = "C-Q"
|
68
70
|
when "\u0012" then chr = "C-R"
|
71
|
+
when "\u0013" then chr = "C-S"
|
69
72
|
when "\u0014" then chr = "C-T"
|
70
73
|
when "\u0015" then chr = "C-U"
|
71
74
|
when "\u0016" then chr = "C-V"
|
@@ -73,7 +76,6 @@ module Rcurses
|
|
73
76
|
when "\u0019" then chr = "C-Y"
|
74
77
|
when "\u001A" then chr = "C-Z"
|
75
78
|
when "\u0017" then chr = "WBACK"
|
76
|
-
when "\u0013" then chr = "C-S"
|
77
79
|
when /[[:print:]]/ then chr = c
|
78
80
|
else chr = ""
|
79
81
|
end
|
data/lib/rcurses/pane.rb
CHANGED
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:
|
4
|
+
version: 2.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geir Isene
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-03-
|
11
|
+
date: 2025-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clipboard
|
@@ -30,7 +30,7 @@ description: 'Create curses applications for the terminal easier than ever. Crea
|
|
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
32
|
in panes. Cursor movement around the terminal. New in 2.4: Show cursor on edit.
|
33
|
-
Changed hide_cursor and show_cursor to hide and show.'
|
33
|
+
Changed hide_cursor and show_cursor to hide and show. 2.4.1: Minor fixes'
|
34
34
|
email: g@isene.com
|
35
35
|
executables: []
|
36
36
|
extensions: []
|