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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c6b5f0fbbc0c9c981c1e4d23197008f4a5ea00cff36492938328fe30c52804af
4
- data.tar.gz: d4ee9ba0743c045168d0528534f5cc3f5571b3e968948d8553afdb768aebb1c3
3
+ metadata.gz: 7c231359439921bfa6f6da0d36db67cf20daf67054031b64b1362cf17a121f36
4
+ data.tar.gz: 07af990392aca529a25aec404f3a92db948eb64dddd4811c8b9f6f80adca5d55
5
5
  SHA512:
6
- metadata.gz: 53b164b30ccb430b541a6880c51d298c8ddaa38b7d5b97b1714c53ca0c5e100caa1883c1caec210816f03704ff3d1b59715c317bd015c480c83e49227a91e7ed
7
- data.tar.gz: 89ecd3c6021dcfd70bf390723de8a7d75210a85b5e73077dfb7f0167f3faad9c68e422b25ef4ed564fa4fd3341d32ac6c90e70132910e025e278f82ec3b892ec
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)
@@ -26,22 +26,23 @@ module Rcurses
26
26
  _row, col = pos
27
27
  col
28
28
  end
29
- def up(n = 1); print(CSI + "#{(n)}A"); end # Move cursor up by n
30
- def down(n = 1); print(CSI + "#{(n)}B"); end # Move the cursor down by n
31
- def left(n = 1); print(CSI + "#{n}D"); end # Move the cursor backward by n
32
- def right(n = 1); print(CSI + "#{n}C"); end # Move the cursor forward by n
33
- def col(n = 1); print(CSI + "#{n}G"); end # Cursor moves to nth position horizontally in the current line
34
- def row(n = 1); print(CSI + "#{n}d"); end # Cursor moves to the nth position vertically in the current column
35
- def next_line; print(CSI + 'E' + CSI + "1G"); end # Move cursor down to beginning of next line
36
- def prev_line; print(CSI + 'A' + CSI + "1G"); end # Move cursor up to beginning of previous line
37
- def clear_char(n = 1); print(CSI + "#{n}X"); end # Erase n characters from the current cursor position
38
- def clear_line; print(CSI + '2K' + CSI + "1G"); end # Erase the entire current line and return to beginning of the line
39
- def clear_line_before; print(CSI + '1K'); end # Erase from the beginning of the line up to and including the current cursor position.
40
- def clear_line_after; print(CSI + '0K'); end # Erase from the current position (inclusive) to the end of the line
41
- def clear_screen_down; print(CSI + 'J'); end # Clear screen down from current row
42
- def scroll_up; print(ESC + 'M'); end # Scroll display up one line
43
- def scroll_down; print(ESC + 'D'); end # Scroll display down one line
44
- def hide; print(CSI + '?25l'); end # Scroll display down one line
45
- def show; print(CSI + '?25h'); end # Scroll display down one line
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
@@ -201,6 +201,11 @@ module Rcurses
201
201
  @txt
202
202
  end
203
203
 
204
+ def puts(txt)
205
+ @text = txt
206
+ refresh
207
+ end
208
+
204
209
  def textformat(cont)
205
210
  # Split the content by '\n'
206
211
  lines = cont.split("\n")
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: '2.4'
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-07 00:00:00.000000000 Z
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: []