Commit graph

624 commits

Author SHA1 Message Date
st0012
b3be030740 [ruby/reline] Rename dialog_pointer_* to dialog_highlight_*
"Pointer" is not what we usually use to describe a selected item.

"Highlight" is a more common word for the scenario so we should use it instead.

b4279d1557
2022-07-22 23:34:49 +09:00
st0012
36ca0e58b6 [ruby/reline] Use color name instead of code (integer) in dialog color APIs
As pointed out in the
[comment](https://github.com/ruby/reline/pull/413#issuecomment-1168033973),
the code is actually a control sequence and not only for colors.

To make the dialog color APIs safer to use, we should restrict its
usages and extract away the bg/fg concept from the input.

So in this commit, I made these changes:

1. The dialog_*_bg/fg_color APIs only takes and returns color names (symbol):
  - :black
  - :red
  - :green
  - :yellow
  - :blue
  - :magenta
  - :cyan
  - :white
2. Add additional dialog_*_bg/fg_color_sequence APIs to access the raw code.

b32a977766
2022-07-16 02:30:23 +09:00
pocari
8c6c3e30f3 [ruby/reline] Enable to change the background color of dialogs. (https://github.com/ruby/reline/pull/413)
bd49537964
2022-06-27 22:28:49 +09:00
st0012
b1397e96da [ruby/reline] Revert "Merge pull request #441 from nevans/workaround-linker-script-so"
This reverts commit 4ccf128ffa, reversing
changes made to a2651419e9.

51053138a4
2022-06-13 19:33:15 +09:00
nicholas a. evans
d020334e9e [ruby/reline] Workaround libncurses.so as a linker script
This maybe isn't probably isn't the best approach, but it will allow
`Fiddle::Terminfo.curses_dl` to work.  I documented more details about
this in an issue on fiddle: https://github.com/ruby/fiddle/issues/107

It is probably better to deal with it there.  But this is workaround is
simpler.

FYI: `reline` itself seems to be working just fine for me _without_
loading ncurses.  But I wanted to be able to use `Reline::Terminfo` for
my own projects. :)

fd4bdb35e2
2022-05-25 06:34:28 +09:00
ima1zumi
bcdbfe4b6e
[ruby/reline] Require Ruby >= 2.6
fix https://github.com/ruby/reline/pull/428

dae9eca323
2022-05-20 17:49:15 +09:00
Tim Pope
37d5890e49 [ruby/reline] Fix support for emacs-ctlx and emacs-meta keymaps
The existing implementation, given the below .inputrc, erroneously
creates a "C-v" key binding:

	set keymap emacs-ctlx
	"\C-v": "[C-x C-v was pressed]"

This fixes it to instead create a "C-x C-v" keybinding.

719f52d231
2022-02-22 18:52:52 +09:00
aycabta
d66e7ec77b [ruby/reline] Add a comment for VK_MENU
ee307c2b01
2022-01-27 20:54:09 +09:00
aycabta
f4ee60543a [ruby/reline] The AltGr behaves exactly the same as Ctrl+Alt
On European keyboards.

75fe9759a4
2022-01-27 20:54:09 +09:00
Postmodern
c155445752 [ruby/reline] Ignore global constants when checking if Fiddle::VERSION exists
If a top-level `VERSION` constant exists, or if a module containing a `VERSION` constant is included into the top-level scope, then `Fiddle.const_defined?(:VERSION)` will erroneously return true when `RUBY_VERSION < 3.0.0`.

8529c8e47a
2022-01-24 07:00:34 +09:00
aycabta
f5e3913737 [ruby/reline] Fix incremental search to work correctly even if not last line
21d75f6d4c
2022-01-16 22:09:31 +09:00
aycabta
921ff739df [ruby/reline] Insert newline in the middle of buffer just after dialog
0c76631132
2022-01-16 22:09:31 +09:00
aycabta
2bc6b07a8d [ruby/reline] Combine common logic into one
5db9738f17
2022-01-16 22:09:29 +09:00
aycabta
f94a2adf6a [ruby/reline] Clear dialog when adding new line to end of buffer
7d38454327
2022-01-16 22:09:28 +09:00
aycabta
9e79ae539b [ruby/reline] Clear dialog when just_move_cursor is called with dialog at last line
05024b968e
2022-01-11 06:10:37 +09:00
Peter Zhu
09cfc653b7 [ruby/reline] Fix reline on Solaris
Solaris requires that the pointer errret_int is alined to an integer,
however, with VWA, strings are no longer aligned to an integer, so use a
Fiddle::Pointer with a malloc'd region instead.

5fcd89ab0c
2022-01-08 20:32:06 +09:00
aycabta
76181ae940 [ruby/reline] Check capname of tigetstr/tigetflag/tigetnum
Incorrect arguments can cause SEGV.

a58748bcf9
2022-01-02 11:44:07 +09:00
aycabta
6d1b406dc8 [ruby/reline] Version 0.3.1
9ab5850444
2022-01-02 11:24:14 +09:00
aycabta
85f304b931 [ruby/reline] Implement Reline::Terminfo.tigetnum
695212d5d2
2022-01-02 10:27:09 +09:00
aycabta
530586fafc [ruby/reline] Fix the difinition of tigetflag() in comment...
af4d77ba09
2022-01-02 00:39:45 +09:00
aycabta
7deee741ab [ruby/reline] Remove unnecessary qualifiers on definition of comments
abc1e4ee88
2022-01-01 23:12:07 +09:00
aycabta
6300c4dcc3 [ruby/reline] Implement Reline::Terminfo.tigetflag
0451ed7a28
2022-01-01 23:06:53 +09:00
YO4
31c69d66d2 [ruby/reline] windows fix scroll
c559d0f7a9
2021-12-30 20:53:21 +09:00
ima1zumi
f589242e75 [ruby/reline] Use unix_line_discard when Ctrl-u is entered
The kill-line was called when C-u was entered, so it is now called unix-line-discard.

In readline(3):

> unix-line-discard (C-u)
>               Kill backward from point to the beginning of the line.
>               The killed text is saved on the kill-ring.

27570d195e
2021-12-30 20:23:58 +09:00
aycabta
40c20110d5 [ruby/reline] Version 0.3.0
3f6ea92268
2021-12-25 10:58:44 +09:00
aycabta
c815c0be46 [ruby/reline] Escape newline(s) in dynamic prompt
9b209ee1ea
2021-12-25 00:32:58 +09:00
aycabta
b0db420b0e [ruby/reline] Escape newline(s) in prompt
b545459fca
2021-12-25 00:32:57 +09:00
aycabta
22cc2243f9 [ruby/reline] Remove unnecessary parameter
20fcd22564
2021-12-25 00:32:56 +09:00
aycabta
4fccefef05 [ruby/reline] Revert "Change aliased methods to be parivete"
Ruby 2.5 doesn't support "private alias_method" idiom  but Ruby on Rails
6.x still support 2.5. 😢

This reverts commit 0f075f562b.

4ecaa63b26
2021-12-24 18:23:28 +09:00
aycabta
fc5bc378e5 [ruby/reline] Change aliased methods to be parivete
0f075f562b
2021-12-24 18:23:28 +09:00
aycabta
a9c59b13da [ruby/reline] Add doc about em-kill-line macro
2e46493aff
2021-12-24 18:23:28 +09:00
aycabta
bad1e153d4 [ruby/reline] Implement em_kill_line
9fca6ceb45
2021-12-24 18:23:28 +09:00
aycabta
6c3cc9c58a [ruby/reline] Rename the wrong name "em-kill-line" with the correct name "unix-line-discard"
da7af35d1f
2021-12-24 18:23:28 +09:00
aycabta
fd60a235f5 [ruby/reline] Add doc about ed-kill-line, kill-line, em-kill-line, and unix-line-discard
586a48ffe0
2021-12-24 18:23:28 +09:00
aycabta
9de42d3b34 [ruby/reline] Bind ed-kill-line to C-u on emacs mode
9ab99574f5
2021-12-24 18:23:28 +09:00
aycabta
15fab6fb17 [ruby/reline] Support S-Tab to move up completion cursor in vi-mode on Unix
ff278cdc88
2021-12-24 18:23:28 +09:00
aycabta
3a59abab08 [ruby/reline] Determine 1st char or 2nd char of surrogate pair correctly
182606c847
2021-12-24 13:57:46 +09:00
aycabta
4bb65ee4fe [ruby/reline] Character merging may increase the character width
Even if the number of graphemes doesn't change owing to character
merging, the character width may increase.

fbcd5f56a7
2021-12-24 00:51:48 +09:00
aycabta
726cc8122e [ruby/reline] "Halfwidth char + halfwidth (han)dakuten" is a single grapheme.
When a halfwidth character is followed by a halfwidth dakuten or a
halfwidth handakuten character, it should be treated as a single
grapheme.

9f20b9ec28
2021-12-24 00:51:47 +09:00
aycabta
daf4a8884b [ruby/reline] Add comment for a following char of combined char
d465667f57
2021-12-24 00:51:46 +09:00
aycabta
37aea9d798 [ruby/reline] Finalize when exception occurred
1f8a3aee43

Co-authored-by: Alex Gittemeier <me@a.lexg.dev>
2021-12-21 00:49:03 +09:00
aycabta
c3a3f65b45 [ruby/reline] Split off set_signal_handler method
In some tests, the LineEditor#reset method is always called, but doesn't
need to set the signal handlers there, so cuts it out to a separate
method.

b143c4f5f9
2021-12-21 00:13:19 +09:00
aycabta
95c61c8d82 [ruby/reline] Remove unnecessary clearing signal handler
7a758e73dc
2021-12-21 00:13:18 +09:00
aycabta
6ccc15c2ab [ruby/reline] Rename an unused variable name for CI
ba97f3bd87
2021-12-20 15:52:51 +09:00
aycabta
145c1e0691 [ruby/reline] Add support for overwriting dialog proc with the same name
16aa20c380
2021-12-20 14:54:42 +09:00
aycabta
cf508d4db9 [ruby/reline] Add space
4b7fa6b213
2021-12-20 14:53:45 +09:00
YO4
2a8ff602e0 [ruby/reline] windows jruby issue
jruby needs terminal control with Windows API  on classic console

b61bc43374
2021-12-20 14:51:52 +09:00
YO4
65cb250cb1 [ruby/reline] windows clear screen with \e 2 J
Windows Terminal does smart screen clearing when \e 2 J (not clear entire screen but scrolls down just needed)

On consoles not support sequences, ruby still converts it to API call.

c00930dab9
2021-12-20 14:51:52 +09:00
YO4
2c415cda85 [ruby/reline] windows improve scrolling
ScrollConsoleScreenBuffer can't scroll window of Windows Terminal.
Use LF to sctoll.

Microsoft says
```In the virtual terminal sequences world, the size of the window and the size of the screen buffer are fixed to the same value.
```
https://docs.microsoft.com/en-us/windows/console/window-and-screen-buffer-size

9ff3c70732
2021-12-20 14:51:51 +09:00
aycabta
a856489be6 [ruby/reline] Revert "Add a space after a comma"
This reverts commit 6009b3ef7a.

To merge a Pull Request...

83021f4267
2021-12-20 14:50:41 +09:00