Граф коммитов

566 Коммитов

Автор SHA1 Сообщение Дата
aycabta 7bcbee37b5 Fix the result of checking the existence of constants being reversed 2021-08-06 02:51:10 +09:00
aycabta de93b8b069 Handle SIGINT in other thread correctly
Co-authored-by: Koichi Sasada <ko1@atdot.net>
2021-08-04 18:29:42 +09:00
aycabta 5bb7b57129 Use Symbol of signal for trap 2021-08-04 18:29:42 +09:00
aycabta 1c9cb9da8f [ruby/reline] Support Terminfo on Cygwin and macOS
https://github.com/ruby/reline/commit/b0b75fcd27
2021-07-30 02:27:02 +09:00
aycabta f1b5cb7e5d [ruby/reline] Don't check the existence of Terminfo on Windows
https://github.com/ruby/reline/commit/320f09055c
2021-07-30 02:27:02 +09:00
aycabta b158b4666d [ruby/reline] Check TYPE_VARIADIC
https://github.com/ruby/reline/commit/8e62e46e33
2021-07-30 02:27:02 +09:00
aycabta 0f496b9b29 [ruby/reline] Define StringWithTiparm instead of singular method
https://github.com/ruby/reline/commit/de234dc875
2021-07-30 02:27:02 +09:00
SilverPhoenix99 5b9f3ed326 [ruby/reline] Fixed Ctrl+Enter key in Windows.
https://github.com/ruby/reline/commit/0c38e39023
2021-07-30 02:27:02 +09:00
aycabta 46c6da9c37 [ruby/reline] Check empty .inputrc
https://github.com/ruby/reline/commit/b60b3b76cd
2021-07-30 02:27:02 +09:00
aycabta 51ee24e7f7 [ruby/reline] Add original C function declarations comment for each function
https://github.com/ruby/reline/commit/9a25ee9f12
2021-07-30 02:27:02 +09:00
Jeremy Evans 44a9337a46 [ruby/reline] Fix reline on OpenBSD
OpenBSD doesn't support tiparm, only tparm.  I'm not sure if the
two are compatible, but this at least this allows me to run irb
on OpenBSD.

https://github.com/ruby/reline/commit/0ce2b34e2b
2021-07-30 02:27:02 +09:00
SilverPhoenix99 1bf768d2e1 [ruby/reline] Added support for Numpad divide key on Windows.
https://github.com/ruby/reline/commit/84577da0c4
2021-07-30 02:27:02 +09:00
aycabta 750359ce81 [ruby/reline] Support Enter key of numpad on Windows
The yamatanooroti gem can't emulate numpad key pressing...

https://github.com/ruby/reline/commit/8e9da1aeaf
2021-07-30 02:27:02 +09:00
Lars Kanis 03f8c27179 [ruby/reline] Windows cmd: Don't type anything when pressing ALT keys alone
Fixes #298

https://github.com/ruby/reline/commit/72acfcd27a
2021-07-30 02:27:02 +09:00
aycabta b0633ee4b3 [ruby/reline] Add TODO comment to implement tigetflag() and tigetnum()
https://github.com/ruby/reline/commit/a0d946a398
2021-07-30 02:27:02 +09:00
Samuel Williams bf376cae0c [ruby/reline] Fix missing require.
https://github.com/ruby/reline/commit/010b28dfe9
2021-06-25 17:42:45 +09:00
Samuel Williams e788481843 [ruby/reline] Avoid using blocking `IO.select`.
https://github.com/ruby/reline/commit/de94746393
2021-06-25 17:42:45 +09:00
aycabta 046fd3ac8c Rescue conversion error of inputrc 2021-06-21 22:12:14 +09:00
aycabta 30cc07fdc1 Check Ruby version to use Fiddle with variadic args in test-all 2021-06-21 18:44:10 +09:00
aycabta 90df426426 [ruby/reline] Version 0.2.6
https://github.com/ruby/reline/commit/5917e3a337
2021-06-21 17:58:49 +09:00
aycabta 95a3cdade6 [ruby/reline] Remove FIXME comment in #render
https://github.com/ruby/reline/commit/acd8f8efbb
2021-06-21 17:58:49 +09:00
aycabta b06218ce6f [ruby/reline] Remove TODO comment in #render_partial
https://github.com/ruby/reline/commit/bb6ea232c2
2021-06-21 17:58:49 +09:00
aycabta 8135f489be [ruby/reline] Add binding C-x C-x to em_exchange_mark on Windows
https://github.com/ruby/reline/commit/24a2489b62
2021-06-21 17:58:49 +09:00
aycabta fa5a258e93 [ruby/reline] Treat C-Space as M-Space on Windows
https://github.com/ruby/reline/commit/69beca2863
2021-06-21 17:58:49 +09:00
aycabta 582b5705ab [ruby/reline] Check existance of a constant, Fiddle::VERSION
https://github.com/ruby/reline/commit/4b74c3d83a
2021-06-21 17:58:48 +09:00
aycabta 18b79b4c49 [ruby/reline] Add Meta+arrow-keys in extended entries of terminfo
https://github.com/ruby/reline/commit/af6f6ed088
2021-06-21 17:58:48 +09:00
aycabta 60d1d6aa89 [ruby/reline] Terminfo.tigetstr should be able to receive tiparm in method chain
https://github.com/ruby/reline/commit/4a3e308163
2021-06-21 17:58:48 +09:00
aycabta 5e09da2f7a [ruby/reline] Terminfo.tigetstr and tiparm should return String object
https://github.com/ruby/reline/commit/1e287d10cc
2021-06-21 17:58:48 +09:00
aycabta 46c813969b [ruby/reline] Add terminfo support
https://github.com/ruby/reline/commit/74a7ffaa2f
2021-06-21 17:58:48 +09:00
aycabta 1b543dc226 [ruby/reline] Handle Errno::ENOTTY correctly
https://github.com/ruby/reline/commit/8daa392ba6
2021-06-21 17:58:48 +09:00
Jeremy Evans 242bad9a87 [ruby/reline] Fix Reline::Unicode.calculate_width when input is not a TTY
This fixes an error when output is redirected:

```
$ run_ruby -rreline -e '$stderr.puts Reline::Unicode.calculate_width("\u221a").inspect' </dev/null >/dev/null
/home/jeremy/tmp/ruby/lib/reline/ansi.rb:189:in `raw': Operation not supported by device (Errno::ENODEV)
```

The @@encoding -> defined?(@@encoding) changes is necessary because
without that part of the commit, the following error would be raised
by the above command:

```
/home/jeremy/tmp/reline/lib/reline/general_io.rb:10:in `encoding': uninitialized class variable @@encoding in Reline::GeneralIO (NameError)
```

Problem reported and initial patch for Windows provided by
Richard Sharman.

I tested this only on OpenBSD, but hopefully it works for other
operating systems.

Fixes [Bug #17493]

https://github.com/ruby/reline/commit/c001971bb3
2021-06-21 17:58:48 +09:00
aycabta 26f31f880c [ruby/reline] Treat return key correctly on Windows
To fix Reline::TestRendering#test_binding_for_vi_movement_mode.

https://github.com/ruby/reline/commit/0df3d2a1dc
2021-06-21 17:58:48 +09:00
aycabta b0cc46b484 [ruby/reline] The config file must accept any character encoding
In Japan, so many programmers used EUC-JP to write text files that contain
Japanese. Many .inputrc files which contain EUC-JP are still being copied and
used. This commit supports the whole encoding of what user set including UTF-8.

ref. https://github.com/ruby/reline/pull/280

https://github.com/ruby/reline/commit/0b45022e16
2021-06-21 17:58:48 +09:00
aycabta c59bbd86a6 [ruby/reline] Use ReadConsoleInputW() instead of getwch()
This needs https://github.com/aycabta/yamatanooroti/pull/19, which is released
by yamatanooroti gem 0.0.7, to test with yamatanooroti.

https://github.com/ruby/reline/commit/06c1f45da1
2021-06-21 17:58:48 +09:00
Mark Delk a049dfd10a [ruby/reline] ensure reline's encoding is used when reading inputrc character values
This change ensures we use `Reline::IOGate`'s `encoding` when converting
characters from their integer values.

This fixes an issue that may occur if you have UTF characters in your
`.inputrc`, but your default encoding isn't set.

For example:

```
> 127864.ord.chr
RangeError: 127864 out of char range
from (pry):1:in `chr'
> Reline::IOGate.encoding
=> #<Encoding:UTF-8>
> 127864.ord.chr(Reline::IOGate.encoding)
=> "🍸"
```

https://github.com/ruby/reline/commit/cf372fc0fc
2021-06-21 17:58:48 +09:00
aycabta 6496c76d2a [ruby/reline] Add calling Reline::Config#reset_default_key_bindings to #reset, which is forgot to call 2021-04-09 11:57:28 +09:00
Nobuyoshi Nakada b0b3022f95
[ruby/reline] Moved development dependencies to Gemfile
As expressions in a gemspec file are evaluated at the build time,
but not the run time, the conditional in the gemspec will not work
as intended.

https://github.com/ruby/reline/commit/c09b7c454a
2021-04-08 21:41:00 +09:00
aycabta 5543695a19
[ruby/reline] Separate keystrokes each editing mode
https://github.com/ruby/reline/commit/ee23e6f3f8
2021-04-08 21:41:00 +09:00
aycabta 16f31da92e
[ruby/reline] Check WITH_VTERM env to add vterm gem as dependency
https://github.com/ruby/reline/commit/27b689a7e2
2021-04-08 21:41:00 +09:00
aycabta 47abb70234 [ruby/reline] Use vterm 0.0.5 or newer on Unix like OSes because suppresses SEGV
https://github.com/ruby/reline/commit/7562cf3b5f
2021-04-03 20:22:56 +09:00
aycabta 8a4472fb6d [ruby/reline] Version 0.2.5
https://github.com/ruby/reline/commit/22ce5651e5
2021-04-03 01:28:42 +09:00
aycabta 7e93917458 [ruby/reline] Reset @rest_height when clear screen
https://github.com/ruby/reline/commit/3a7019b0d5
2021-04-02 17:33:48 +09:00
aycabta 89caf51d93 [ruby/reline] Suppress crashing when completer_{quote,word_break}_characters is empty
https://github.com/ruby/reline/commit/c6f1164942
2021-03-24 15:43:34 +09:00
aycabta 758f2b35f9 [ruby/reline] Support preposing and postposing for Reline.completion_proc
https://github.com/ruby/reline/commit/1f469de90c
2021-03-24 15:43:27 +09:00
aycabta 4b33d860e8 [ruby/reline] Reline.delete_text removes the current line in multiline
https://github.com/ruby/reline/commit/da90c094a1
2021-03-24 15:43:19 +09:00
aycabta f0743dd2a4 [ruby/reline] Version 0.2.4
https://github.com/ruby/reline/commit/462f971bd3
2021-02-26 05:24:01 +09:00
cremno a7dda449e8 [ruby/reline] fix Reline::Windows.getconsolemode buffer
use double quotes to properly convert the \000 escape sequence.

https://github.com/ruby/reline/commit/236dfe5683
2021-02-22 12:19:21 +09:00
aycabta aeac4ddcc0 [ruby/reline] Use UTF-8 only for width calc, rest uses original encoding
I confirmed that libvterm supports only which are UTF-8, US ASCII, UK, and
DEC graphics by reading source code, so can't test this patch by
yamatanoorogi gem through vterm gem for now.

This fixes ruby/irb#190.

https://github.com/ruby/reline/commit/44596c0cc7
2021-02-21 06:44:05 +09:00
Yoshinao Muramatu 38d30a6942 [ruby/reline] check ENABLE_VIRTUAL_TERMINAL_PROCESSING flag and switch eof processing
https://github.com/ruby/reline/commit/3535676689
2021-02-21 06:43:52 +09:00
Yoshinao Muramatu 38cefac7ce [ruby/reline] We still need support new and legacy behavior.
Revert "Support for change in Windows-specific behavior at eol"

This reverts commit cad4de6ee841b43f3f0e441626f9415c3eda0f82.

https://github.com/ruby/reline/commit/646587fc2c
2021-02-21 06:43:41 +09:00
Eamonn Webster ac9e3b514b [ruby/reline] Avoid tripping over nil prompt
https://github.com/ruby/reline/commit/d4d9d3e3d4
2021-02-21 06:41:11 +09:00
aycabta dc9e33016c [ruby/reline] Return 1 when char width not found
This fixes ruby/reline#261.

https://github.com/ruby/reline/commit/3cf1213014
2021-02-21 06:41:03 +09:00
aycabta 93ebfed0a9 [ruby/reline] Version 0.2.3
https://github.com/ruby/reline/commit/b26c7d60c8
2021-02-07 05:29:31 +09:00
aycabta 300084a854 [ruby/reline] Terminate correctly in the middle of lines higher than the screen
https://github.com/ruby/reline/commit/e1d9240ada
2021-02-07 05:12:19 +09:00
aycabta fee19da230 [ruby/reline] Autowrap correctly when inserting chars in the middle of a line
https://github.com/ruby/reline/commit/ebaf37255f
2021-02-07 05:12:07 +09:00
aycabta a19ed1623f [ruby/reline] The vi_histedit supports multiline
This closes ruby/reline#253.

https://github.com/ruby/reline/commit/f131f86d71
2021-02-07 05:11:54 +09:00
aycabta a608bb3e9b [ruby/reline] Move cursor just after the last line when finished
https://github.com/ruby/reline/commit/ba06e4c480
2021-02-07 05:11:47 +09:00
aycabta 08162f0e69 [ruby/reline] Update cursor info by inserting newline even if not in pasting
https://github.com/ruby/reline/commit/92d314f514
2021-02-07 05:11:41 +09:00
aycabta b371ca3f4f [ruby/reline] Handle past logs correctly when the code is higher than the screen
https://github.com/ruby/reline/commit/f197139b4a
2021-02-07 05:11:27 +09:00
aycabta bd0f8b36fd [ruby/reline] Show all lines higher than the screen when finished
On Unix-like OSes, logs prior to the screen are not editable. When the code
is higher than the screen, the code is only shown on the screen until input
is finished, but when it is finished, all lines are outputted.

https://github.com/ruby/reline/commit/8cd9132a39
2021-02-07 05:11:13 +09:00
aycabta 03523fdafb [ruby/reline] Scroll down when ^C is pressed
https://github.com/ruby/reline/commit/6877a7e3f5
2021-02-07 05:11:00 +09:00
aycabta ec6929a5dd [ruby/reline] Remove an unused variable
https://github.com/ruby/reline/commit/123ea51166
2021-02-07 05:10:50 +09:00
aycabta 433b975fe8 [ruby/reline] Initialize uninitialized variables in tests
https://github.com/ruby/reline/commit/25af4bb64b
2021-02-07 05:10:36 +09:00
aycabta b69c965f47 [ruby/reline] Cache pasting state in processing a key
Because it's too slow.

The rendering time in IRB has been reduced as follows:

  start = Time.now

  def each_top_level_statement
    initialize_input
    catch(:TERM_INPUT) do
      loop do
        begin
          prompt
          unless l = lex
            throw :TERM_INPUT if @line == ''
          else
            @line_no += l.count("\n")
            next if l == "\n"
            @line.concat l
            if @code_block_open or @ltype or @continue or @indent > 0
              next
            end
          end
          if @line != "\n"
            @line.force_encoding(@io.encoding)
            yield @line, @exp_line_no
          end
          break if @io.eof?
          @line = ''
          @exp_line_no = @line_no

          @indent = 0
        rescue TerminateLineInput
          initialize_input
          prompt
        end
      end
    end
  end

  puts "Duration: #{Time.now - start} seconds"

0.22sec -> 0.14sec

https://github.com/ruby/reline/commit/b8b3dd52c0
2021-02-07 05:09:18 +09:00
aycabta edafde6844 [ruby/irb] [ruby/irb] [ruby/reline] Version 0.2.2
https://github.com/ruby/reline/commit/dfb710946f

https://github.com/ruby/irb/commit/1a1cdf9628

https://github.com/ruby/irb/commit/fe99faf8bd
2021-01-18 02:10:02 +09:00
aycabta e1449ae74f [ruby/reline] Reline::Windows.erase_after_cursor erases attributes too
https://github.com/ruby/reline/commit/68b961dfc7
2021-01-18 02:09:53 +09:00
aycabta 05df7e0d4a [ruby/reline] Support for change in Windows-specific behavior at eol
The behavior of automatically moving the cursor to the next line when
displaying a char at the eol on Windows suddenly disappeared.

https://github.com/ruby/reline/commit/cad4de6ee8
2021-01-18 02:09:43 +09:00
aycabta 1aba1a5103 [ruby/reline] Initialize a variable just in case
https://github.com/ruby/reline/commit/29b10f6e98
2021-01-18 02:07:37 +09:00
aycabta 0e44247508 [ruby/reline] Version 0.2.1
https://github.com/ruby/reline/commit/a3b3c6ee60
2021-01-13 01:12:54 +09:00
aycabta eb5a094fc0 [ruby/reline] Move the cursor correctly when deleting at eol
This fixes ruby/reline#246.

https://github.com/ruby/reline/commit/07a73ba601
2021-01-13 01:12:54 +09:00
aycabta 44817db28b [ruby/reline] Handle ed_search_{prev,next}_history in multiline correctly
The current line was being handled incorrectly when displaying the hit
history, so it has been fixed to be correct.

https://github.com/ruby/reline/commit/a3df4343b3
2021-01-13 01:12:54 +09:00
aycabta a8f4cbeece [ruby/reline] Add acknowledgments and license for rb-readline
https://github.com/ruby/reline/commit/19df59b916
2021-01-08 13:25:18 +09:00
aycabta 01235f800f [ruby/reline] Suppress auto indent for adding newlines in pasting
Co-authored-by: Juanito Fatas <me@juanitofatas.com>

https://github.com/ruby/reline/commit/074bb017a7
2021-01-08 13:25:18 +09:00
aycabta 76c9a3c8c6 [ruby/reline] Suppress crashing when dynamic_prompt_proc returns a broken prompt list
Co-authored-by: Juanito Fatas <me@juanitofatas.com>

https://github.com/ruby/reline/commit/558f7be168
2021-01-08 13:25:18 +09:00
aycabta 88af5085db [ruby/reline] Suppress crashing when auto_indent_proc returns broken indent info
Co-authored-by: Juanito Fatas <me@juanitofatas.com>

https://github.com/ruby/reline/commit/7c24276275
2021-01-08 13:25:18 +09:00
aycabta ea75aed98e [ruby/reline] Correct var names in Reline were different from vi-*-mode-string
https://github.com/ruby/reline/commit/8255fc93b9
2021-01-08 13:25:18 +09:00
aycabta 54c1dcba2b [ruby/reline] Update cursor correctly when just cursor moving
This fixes ruby/reline#236 and ruby/reline#239.

https://github.com/ruby/reline/commit/3e3c89d00b
2021-01-08 13:25:18 +09:00
aycabta 523b520b44 [ruby/reline] 0.2.0
https://github.com/ruby/reline/commit/064664c8f9
2020-12-25 01:29:18 +09:00
aycabta 9a7647d9eb [ruby/reline] Doesn't contain terminate spaces by cw
This closes ruby/reline#233.

https://github.com/ruby/reline/commit/4c3f2e2eae
2020-12-24 23:26:22 +09:00
aycabta 78421319d0 [ruby/reline] Use #bytesize for vi_replace_char
This closes ruby/reline#228.

https://github.com/ruby/reline/commit/8205fa0b00
2020-12-24 23:26:22 +09:00
aycabta 0db9842b2c [ruby/reline] Delete the last char of a line by dw
This closes ruby/reline#229.

https://github.com/ruby/reline/commit/3f0ae689c4
2020-12-24 23:26:22 +09:00
aycabta 8d5d139afa [ruby/reline] Suppress crashing when boken prompt_list is given
https://github.com/ruby/reline/commit/922d087e7a
2020-12-24 23:26:22 +09:00
aycabta 634b231f33 [ruby/reline] Discard prompt cache by changing mode icon
https://github.com/ruby/reline/commit/bfeda8a79b
2020-12-24 23:26:22 +09:00
aycabta b52bc4a9c2 [ruby/reline] Support isearch-terminators
https://github.com/ruby/reline/commit/a7922da16b
2020-12-22 23:45:43 +09:00
aycabta 294552ca6c [ruby/reline] Render refreshed prompt just after i-search finished
https://github.com/ruby/reline/commit/0d3188fe34
2020-12-22 23:45:43 +09:00
aycabta a7cacd33cc [ruby/reline] Version 0.1.10
https://github.com/ruby/reline/commit/723c6e191a
2020-12-20 16:23:59 +09:00
aycabta c2a5594e27 [ruby/reline] Use cached prompt list when just moved the cursor
https://github.com/ruby/reline/commit/cfe619460b
2020-12-19 02:12:11 +09:00
aycabta d4257c6152 [ruby/reline] Yank by em-kill-region correctly
This closes ruby/reline#106.

https://github.com/ruby/reline/commit/2549a52e15
2020-12-19 02:12:11 +09:00
aycabta af2c81e10c [ruby/reline] Bind yank-pop correctly
https://github.com/ruby/reline/commit/3c74beac65
2020-12-19 02:12:11 +09:00
aycabta 671f2762fb [ruby/reline] Add Enumerable to KillRing for debugging
https://github.com/ruby/reline/commit/d208874152
2020-12-19 02:12:11 +09:00
Robert Schulze 422e2c7274 [ruby/reline] Use plus operator to create unfrozen string
https://github.com/ruby/reline/commit/ca274b0d37
2020-12-17 20:20:07 +09:00
aycabta cdf2790aa0 [ruby/reline] Support longer than screen height on Windows
https://github.com/ruby/reline/commit/2a97ca9362
2020-12-17 20:17:22 +09:00
aycabta 2b8fa78176 [ruby/reline] Support longer than screen height
https://github.com/ruby/reline/commit/e83a3de9ed
2020-12-17 20:14:59 +09:00
Yale Kozinski d597d7a8b6 Fixing glitchy kill ring behavior in irb
See https://github.com/ruby/irb/issues/85 for details
2020-12-17 20:04:42 +09:00
ima1zumi 68d3952c52 [ruby/reline] Fix breaking to input Emoji with ZWJ.
https://github.com/ruby/reline/commit/f21dfdbb11
2020-12-11 23:08:06 +09:00
aycabta 3bf7b999e5 [ruby/reline] Editing to initial content is not just cursor moving
https://github.com/ruby/reline/commit/0a4f175b0a
2020-12-08 00:08:41 +09:00
Robert Schulze f4386413f1 Cope with frozen-string-literal
When running irb 1.2.1 (2019-12-24) with frozen-string-literal enabled, it crashes in reline with `can't modify frozen String (FrozenError)`

Steps to reproduce: 

`RUBYOPT="--enable-frozen-string-literal" irb`
2020-12-05 03:14:42 +09:00
aycabta 0cf073088e [ruby/reline] Process insertion buffer forcibly
https://github.com/ruby/reline/commit/89d49ec9e0
2020-12-05 02:58:59 +09:00
aycabta c2bd5b84d0 [ruby/reline] Support bracketed paste mode
https://github.com/ruby/reline/commit/d1a6869322
2020-12-05 02:58:59 +09:00
aycabta 7624f52757 [ruby/reline] Forced newline insertion is not just cursor moving
https://github.com/ruby/reline/commit/0e30a49d03
2020-12-05 02:58:59 +09:00
aycabta 37a574b527 [ruby/reline] Drop prompt list cache when num of lines is changed
https://github.com/ruby/reline/commit/1959e22043
2020-12-05 02:58:59 +09:00
aycabta 2910684c45 [ruby/reline] Cache dynamic prompt for 0.5sec
https://github.com/ruby/reline/commit/06b89d0e61
2020-12-05 02:58:59 +09:00
aycabta b763c5cdf0 [ruby/reline] Stop rerendering if the cursor is only moved
https://github.com/ruby/reline/commit/30e8eaf855
2020-12-05 02:58:59 +09:00
aycabta a297565a4e [ruby/reline] Split #rerender method that is too huge
https://github.com/ruby/reline/commit/d0fbc89253
2020-12-05 02:58:59 +09:00
aycabta 493f381c32 [ruby/reline] Version 0.1.9
https://github.com/ruby/reline/commit/0b1b5e77ce
2020-12-05 02:58:59 +09:00
aycabta b545ab219b [ruby/reline] Stop rerendering whole screen when adding newline at end of buffer
The rendering time in IRB has been reduced as follows:

  start = Time.now

  def each_top_level_statement
    initialize_input
    catch(:TERM_INPUT) do
      loop do
        begin
          prompt
          unless l = lex
            throw :TERM_INPUT if @line == ''
          else
            @line_no += l.count("\n")
            next if l == "\n"
            @line.concat l
            if @code_block_open or @ltype or @continue or @indent > 0
              next
            end
          end
          if @line != "\n"
            @line.force_encoding(@io.encoding)
            yield @line, @exp_line_no
          end
          break if @io.eof?
          @line = ''
          @exp_line_no = @line_no

          @indent = 0
        rescue TerminateLineInput
          initialize_input
          prompt
        end
      end
    end
  end

  puts "Duration: #{Time.now - start} seconds"

0.33sec -> 0.22sec

https://github.com/ruby/reline/commit/496c6a1892
2020-12-05 02:58:59 +09:00
aycabta fb2fda9a27 [ruby/reline] Optimize regexp handling for width
The rendering time in IRB has been reduced as follows:

  start = Time.now

  [{"_id"=>"5f9072a4589a06d2d74b6028",
    "index"=>0,
    "guid"=>"6b3051e2-dbc7-4537-bdb9-6cd7bb5358a7",
    "isActive"=>true,
    "balance"=>"$1,442.84",
    "picture"=>"http://placehold.it/32x32",
    "age"=>34,
    "eyeColor"=>"blue",
    "name"=>{"first"=>"Ward", "last"=>"Levy"},
    "company"=>"HYPLEX",
    "email"=>"ward.levy@hyplex.us",
    "phone"=>"+1 (867) 568-3319",
    "address"=>"867 Cobek Court, Clara, Maryland, 3254",
    "about"=>
     "Exercitation eu ex aliqua sit. Pariatur aliquip incididunt sint id non consectetur ullamco Lorem ea mollit duis amet sint labore. Commodo laborum labore commodo officia in cillum adipisicing esse excepteur cupidatat adipisicing ut. Non esse incididunt voluptate aliquip cillum eu aute duis laboris sit et. Amet enim quis tempor occaecat excepteur exercitation excepteur deserunt amet cillum adipisicing.",
    "registered"=>"Monday, May 25, 2015 6:51 AM",
    "latitude"=>"16.001127",
    "longitude"=>"-72.377848",
    "tags"=>["dolore", "nostrud", "occaecat", "cillum", "nisi"],
    "range"=>[0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
    "friends"=>
     [{"id"=>0, "name"=>"Alison Bryant"},
      {"id"=>1, "name"=>"Ester Espinoza"},
      {"id"=>2, "name"=>"Sullivan Kane"}],
    "greeting"=>"Hello, Ward! You have 7 unread messages.",
    "favoriteFruit"=>"apple"}]

  puts "Duration: #{Time.now - start} seconds"

0.47sec -> 0.34sec

  start = Time.now

  "Exercitation eu ex aliqua sit. Pariatur aliquip incididunt sint id non consectetur ullamco Lorem ea mollit duis amet sint labore. Commodo laborum labore commodo officia in cillum adipisicing esse excepteur cupidatat adipisicing ut. Non esse incididunt voluptate aliquip cillum eu aute duis laboris sit et. Amet enim quis tempor occaecat excepteur exercitation excepteur deserunt amet cillum adipisicing."

  puts "Duration: #{Time.now - start} seconds"

0.11sec -> 0.08sec

  start = Time.now

  def each_top_level_statement
    initialize_input
    catch(:TERM_INPUT) do
      loop do
        begin
          prompt
          unless l = lex
            throw :TERM_INPUT if @line == ''
          else
            @line_no += l.count("\n")
            next if l == "\n"
            @line.concat l
            if @code_block_open or @ltype or @continue or @indent > 0
              next
            end
          end
          if @line != "\n"
            @line.force_encoding(@io.encoding)
            yield @line, @exp_line_no
          end
          break if @io.eof?
          @line = ''
          @exp_line_no = @line_no

          @indent = 0
        rescue TerminateLineInput
          initialize_input
          prompt
        end
      end
    end
  end

  puts "Duration: #{Time.now - start} seconds"

0.40sec -> 0.33sec

Co-authored-by: NARUSE, Yui <naruse@airemix.jp>

https://github.com/ruby/reline/commit/a9e39ddcc4
2020-12-05 02:58:59 +09:00
aycabta 3d0bcf1cc2 [ruby/reline] Optimize ASCII character width calculation
The rendering time in IRB has been reduced as follows:

  start = Time.now

  [{"_id"=>"5f9072a4589a06d2d74b6028",
    "index"=>0,
    "guid"=>"6b3051e2-dbc7-4537-bdb9-6cd7bb5358a7",
    "isActive"=>true,
    "balance"=>"$1,442.84",
    "picture"=>"http://placehold.it/32x32",
    "age"=>34,
    "eyeColor"=>"blue",
    "name"=>{"first"=>"Ward", "last"=>"Levy"},
    "company"=>"HYPLEX",
    "email"=>"ward.levy@hyplex.us",
    "phone"=>"+1 (867) 568-3319",
    "address"=>"867 Cobek Court, Clara, Maryland, 3254",
    "about"=>
     "Exercitation eu ex aliqua sit. Pariatur aliquip incididunt sint id non consectetur ullamco Lorem ea mollit duis amet sint labore. Commodo laborum labore commodo officia in cillum adipisicing esse excepteur cupidatat adipisicing ut. Non esse incididunt voluptate aliquip cillum eu aute duis laboris sit et. Amet enim quis tempor occaecat excepteur exercitation excepteur deserunt amet cillum adipisicing.",
    "registered"=>"Monday, May 25, 2015 6:51 AM",
    "latitude"=>"16.001127",
    "longitude"=>"-72.377848",
    "tags"=>["dolore", "nostrud", "occaecat", "cillum", "nisi"],
    "range"=>[0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
    "friends"=>
     [{"id"=>0, "name"=>"Alison Bryant"},
      {"id"=>1, "name"=>"Ester Espinoza"},
      {"id"=>2, "name"=>"Sullivan Kane"}],
    "greeting"=>"Hello, Ward! You have 7 unread messages.",
    "favoriteFruit"=>"apple"}]

  puts "Duration: #{Time.now - start} seconds"

0.73sec -> 0.43sec

  start = Time.now

  "Exercitation eu ex aliqua sit. Pariatur aliquip incididunt sint id non consectetur ullamco Lorem ea mollit duis amet sint labore. Commodo laborum labore commodo officia in cillum adipisicing esse excepteur cupidatat adipisicing ut. Non esse incididunt voluptate aliquip cillum eu aute duis laboris sit et. Amet enim quis tempor occaecat excepteur exercitation excepteur deserunt amet cillum adipisicing."

  puts "Duration: #{Time.now - start} seconds"

0.15sec -> 0.10sec

  start = Time.now

  def each_top_level_statement
    initialize_input
    catch(:TERM_INPUT) do
      loop do
        begin
          prompt
          unless l = lex
            throw :TERM_INPUT if @line == ''
          else
            @line_no += l.count("\n")
            next if l == "\n"
            @line.concat l
            if @code_block_open or @ltype or @continue or @indent > 0
              next
            end
          end
          if @line != "\n"
            @line.force_encoding(@io.encoding)
            yield @line, @exp_line_no
          end
          break if @io.eof?
          @line = ''
          @exp_line_no = @line_no

          @indent = 0
        rescue TerminateLineInput
          initialize_input
          prompt
        end
      end
    end
  end

  puts "Duration: #{Time.now - start} seconds"

0.59sec -> 0.38sec

Co-authored-by: NARUSE, Yui <naruse@airemix.jp>

https://github.com/ruby/reline/commit/36bc9e3abb
2020-12-05 02:58:59 +09:00
aycabta c85035363f [ruby/reline] Key strokes like 2dl should behave d2l
Key strokes, vi arg, operator, and motion should be treated as operator, vi
arg, and motion.

https://github.com/ruby/reline/commit/d1a7e74aa4
2020-12-05 02:58:58 +09:00
manga_osyo e47e5db889 [ruby/reline] Fix crash to input `é`. refs #174
https://github.com/ruby/reline/commit/ba5e267e5f
2020-12-05 02:58:58 +09:00
aycabta ff4656ee64 [ruby/reline] Version 0.1.8
https://github.com/ruby/reline/commit/e79e402c01
2020-12-05 02:58:58 +09:00
aycabta dbfc1f30d5 [ruby/reline] Add alias vi-movement-mode to vi-command-mode for compatibility
https://github.com/ruby/reline/commit/a79c297567
2020-12-05 02:58:58 +09:00
aycabta 48742614df [ruby/reline] Move alias_method to right after original definition
https://github.com/ruby/reline/commit/b7c8b93fa9
2020-12-05 02:58:58 +09:00
aycabta 9750c27afc [ruby/reline] Call process_insert when the end of pasting plural fullwidth chars
https://github.com/ruby/reline/commit/594484d9f9
2020-12-05 02:58:58 +09:00
aycabta ba8e5f77eb [ruby/reline] Motions e, E, t, f should include a char on cursor if follows operator
https://github.com/ruby/reline/commit/86e9a76499
2020-12-05 02:58:58 +09:00
aycabta 6be3b2da19 [ruby/reline] Implement vi_yank
https://github.com/ruby/reline/commit/164aaf9a5f
2020-12-05 02:58:58 +09:00
aycabta 2dc4aca8d1 [ruby/reline] Operator with arg need to make sure that they take arg to avoid crashing
https://github.com/ruby/reline/commit/1c0c06de1f
2020-12-05 02:58:58 +09:00
aycabta 92b22db6a7 [ruby/reline] Unimplemented vi command should be no-op
https://github.com/ruby/reline/commit/abc90e6867
2020-12-05 02:58:58 +09:00
aycabta faf8f216be [ruby/reline] Keep operator proc as a local variable in the scope
The proc variable will be used later so the instance variable will be changes.

https://github.com/ruby/reline/commit/496c4361f6
2020-12-05 02:58:58 +09:00
aycabta 564aadce62 [ruby/reline] Skip em_exchange_mark without mark
https://github.com/ruby/reline/commit/abb56e5ec3
2020-12-05 02:58:58 +09:00
aycabta e6429ad047 [ruby/reline] Backspace and C-h should be unassigned on vi command mode
https://github.com/ruby/reline/commit/28f4dae020
2020-12-05 02:58:58 +09:00
aycabta 853c176ea7 [ruby/reline] Version 0.1.7
https://github.com/ruby/reline/commit/710ca23427
2020-12-05 02:58:58 +09:00
aycabta 266ffdde8e [ruby/reline] Continuous insertion buffering
The rendering time in IRB has been reduced as follows:

  start = Time.now

  [{"_id"=>"5f9072a4589a06d2d74b6028",
    "index"=>0,
    "guid"=>"6b3051e2-dbc7-4537-bdb9-6cd7bb5358a7",
    "isActive"=>true,
    "balance"=>"$1,442.84",
    "picture"=>"http://placehold.it/32x32",
    "age"=>34,
    "eyeColor"=>"blue",
    "name"=>{"first"=>"Ward", "last"=>"Levy"},
    "company"=>"HYPLEX",
    "email"=>"ward.levy@hyplex.us",
    "phone"=>"+1 (867) 568-3319",
    "address"=>"867 Cobek Court, Clara, Maryland, 3254",
    "about"=>
     "Exercitation eu ex aliqua sit. Pariatur aliquip incididunt sint id non consectetur ullamco Lorem ea mollit duis amet sint labore. Commodo laborum labore commodo officia in cillum adipisicing esse excepteur cupidatat adipisicing ut. Non esse incididunt voluptate aliquip cillum eu aute duis laboris sit et. Amet enim quis tempor occaecat excepteur exercitation excepteur deserunt amet cillum adipisicing.",
    "registered"=>"Monday, May 25, 2015 6:51 AM",
    "latitude"=>"16.001127",
    "longitude"=>"-72.377848",
    "tags"=>["dolore", "nostrud", "occaecat", "cillum", "nisi"],
    "range"=>[0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
    "friends"=>
     [{"id"=>0, "name"=>"Alison Bryant"},
      {"id"=>1, "name"=>"Ester Espinoza"},
      {"id"=>2, "name"=>"Sullivan Kane"}],
    "greeting"=>"Hello, Ward! You have 7 unread messages.",
    "favoriteFruit"=>"apple"}]

  puts "Duration: #{Time.now - start} seconds"

2.17sec -> 0.92sec

  start = Time.now

  "Exercitation eu ex aliqua sit. Pariatur aliquip incididunt sint id non consectetur ullamco Lorem ea mollit duis amet sint labore. Commodo laborum labore commodo officia in cillum adipisicing esse excepteur cupidatat adipisicing ut. Non esse incididunt voluptate aliquip cillum eu aute duis laboris sit et. Amet enim quis tempor occaecat excepteur exercitation excepteur deserunt amet cillum adipisicing."

  puts "Duration: #{Time.now - start} seconds"

1.57sec -> 0.22sec

  start = Time.now

  def each_top_level_statement
    initialize_input
    catch(:TERM_INPUT) do
      loop do
        begin
          prompt
          unless l = lex
            throw :TERM_INPUT if @line == ''
          else
            @line_no += l.count("\n")
            next if l == "\n"
            @line.concat l
            if @code_block_open or @ltype or @continue or @indent > 0
              next
            end
          end
          if @line != "\n"
            @line.force_encoding(@io.encoding)
            yield @line, @exp_line_no
          end
          break if @io.eof?
          @line = ''
          @exp_line_no = @line_no

          @indent = 0
        rescue TerminateLineInput
          initialize_input
          prompt
        end
      end
    end
  end

  puts "Duration: #{Time.now - start} seconds"

0.88sec -> 0.77sec

https://github.com/ruby/reline/commit/7d87ac5a12
2020-12-05 02:58:58 +09:00
Yusuke Endoh 76cac4c05a [ruby/reline] Improve the performance of `get_mbchar_width`
It is about three times faster to use one big regexp instead of
sequential matching.

https://github.com/ruby/reline/commit/e36f6c0707
2020-12-05 02:58:58 +09:00
aycabta b3e0db8060 [ruby/reline] Version 0.1.6
https://github.com/ruby/reline/commit/20a7806815
2020-12-05 02:58:58 +09:00
Yusuke Endoh 9461cceb8a [ruby/reline] Update the generator script too
https://github.com/ruby/reline/commit/8b0926820a
2020-12-05 02:58:58 +09:00
aycabta 55cc397a87 [ruby/reline] Suppress callbacks in pasting
IRB uses Reline's 3 dynamic real-time callbacks with calling Ripper;
output_modifier_proc, prompt_proc, and auto_indent_proc. These processing
times make the paste time too long.

https://github.com/ruby/reline/commit/beec3399a8
2020-12-05 02:58:58 +09:00
Yusuke Endoh 6a51d393ca [ruby/reline] Improve the regexps for EastAsianWidth
A character class is about three times faster than Regexp alternatives

https://github.com/ruby/reline/commit/57c7955c55
2020-12-05 02:58:58 +09:00
aycabta 4af2e4111b [ruby/reline] Deduplicate completed items
https://github.com/ruby/reline/commit/2dabf0c786
2020-12-05 02:58:58 +09:00
aycabta e16e481385 [ruby/reline] Use yamatanooroti 0.0.6 for supporting startup_message on Windows
https://github.com/ruby/reline/commit/167423b664
2020-12-05 02:58:58 +09:00
aycabta 87f51c7e66 [ruby/reline] Use startup_option instead of startup wait
https://github.com/ruby/reline/commit/a63ce6371c
2020-12-05 02:58:58 +09:00
aycabta d5cf3fcd68 [ruby/reline] Update to Unicode 13.0.0
https://github.com/ruby/reline/commit/d49bb0aa34
2020-12-05 02:58:58 +09:00
aycabta 3a3e933033 [ruby/reline] Version 0.1.5
https://github.com/ruby/reline/commit/c8a419beb5
2020-09-14 02:12:12 +09:00
aycabta ae508633b7 Suppress "assigned but unused variable" warning 2020-09-12 10:07:18 +09:00
aycabta 777d536749 [ruby/reline] Support for word movement escape sequences in iTerm2
https://github.com/ruby/reline/commit/187235f88c
2020-09-12 08:35:52 +09:00
aycabta f36dc2b6de [ruby/reline] Treat prompt correctly when Reline.prompt_proc isn't set
https://github.com/ruby/reline/commit/9c9ba0eff3
2020-09-12 08:35:52 +09:00
aycabta ce389ade45 [ruby/reline] Move cursor to currect vertical pos after rendering a logical line
https://github.com/ruby/reline/commit/9b932df544
2020-09-12 08:35:52 +09:00
aycabta 9baf1bd0a4 [ruby/reline] Stop using chomp option of lines method
https://github.com/ruby/reline/commit/3e2f55c3e0
2020-09-12 08:35:52 +09:00
aycabta 0ec19cc843 [ruby/reline] Stop erasing chars after the cursor at eol
When the cursor is at the end of the line and erases characters after the
cursor, some terminals delete the character at the cursor position.

https://github.com/ruby/reline/commit/e96ec97b02
2020-09-12 08:35:52 +09:00
aycabta 2e34b35a0f [ruby/reline] Skip the nil obtained from getc
The nil means there is nothing in the buffer in some systems. Incidentally,
Errno::EIO is raised if the I/O is closed.

https://github.com/ruby/reline/commit/c698634e74
2020-09-12 08:35:52 +09:00
Yoshinao Muramatu a840ef8569 [ruby/reline] not clear scrollback buffer
https://github.com/ruby/reline/commit/ba800f1461
2020-09-12 08:35:51 +09:00
Yoshinao Muramatu 0862744010 [ruby/reline] clear_screen use Windows API
https://github.com/ruby/reline/commit/2c5ee54cb3
2020-09-12 08:35:51 +09:00
aycabta 770e66030a [ruby/reline] Use str.encoding by default for split_by_width
https://github.com/ruby/reline/commit/2d32604c9e
2020-09-12 08:35:51 +09:00
Hiroshi SHIBATA b194973dcd
Revert the related commits about `Tempfile.open` change.
Start with fa21985a7a
  to d7492a0be8
2020-09-09 21:10:48 +09:00
Benoit Daloze 3beecafc2c Fix usages of Tempfile.open(&block) that expected the file to still be there after the block 2020-08-29 12:30:24 +02:00
aycabta 1f09c43628 [ruby/reline] Move width calculator methods to Reline::Unicode
https://github.com/ruby/reline/commit/f348ecd9f5
2020-08-28 11:05:18 +09:00
tompng cdd7d41046 [ruby/reline] fix cursor_pos regexp match
https://github.com/ruby/reline/commit/1dd80ef188
2020-08-28 11:05:18 +09:00
Nobuyoshi Nakada 4f697bcf73
Strip trailing spaces [ci skip] 2020-08-18 20:10:34 +09:00
Nobuyoshi Nakada f2435c1508 [ruby/reline] Get rid of loading pathname unnecessarily
https://github.com/ruby/reline/commit/9bd54b7f1c
2020-08-18 19:09:58 +09:00
Maciej Mensfeld d1b06229fa [ruby/reline] Use the standard SPDX ID for license in gemspec
It is better to use SPDX ID for license field:

https://guides.rubygems.org/specification-reference/#license=

ref: https://spdx.org/licenses/Ruby.html
https://github.com/ruby/reline/commit/8468a727e5
2020-08-18 19:09:43 +09:00
aycabta ad24eaabfd [ruby/reline] Remove duplicated line of code
Co-authored-by: Quentin Sabah <quentin.sabah@gmail.com>

https://github.com/ruby/reline/commit/5526e9f7ee
2020-08-18 19:08:50 +09:00
aycabta 80a7358cfc [ruby/reline] Keep original characters in inputrc
https://github.com/ruby/reline/commit/96583c6336
2020-08-18 19:08:40 +09:00
Mark Delk 44b24ab4c1 [ruby/reline] Support mode icon
Co-authored-by: aycabta <aycabta@gmail.com>

https://github.com/ruby/reline/commit/067b618123
2020-08-18 19:08:32 +09:00
aycabta 568615d395 [ruby/reline] Use single quotes for non-expanded string literals
https://github.com/ruby/reline/commit/3bf7c7d722
2020-08-18 19:08:11 +09:00
aycabta 215fe54777 [ruby/reline] Check Errno::EIO
Catch Errno::EIO what will be occurred if the console terminates I/O before
Reline finishes rendering.

https://github.com/ruby/reline/commit/e51eaa6d43
2020-08-18 19:04:31 +09:00
Tomás Pollak f0d3d4fedb [ruby/reline] Add home/end mapping for urxvt and relatives
https://github.com/ruby/reline/commit/c30b293f1c
2020-08-18 19:03:27 +09:00
aycabta f56e05fa7d [ruby/reline] Remove unnecessary TODO commnet
https://github.com/ruby/reline/commit/23c67fb7b3
2020-05-17 19:26:53 +09:00
aycabta fc2a121c7c [ruby/reline] If history-size isn't numeric, it should be 500
https://tiswww.case.edu/php/chet/readline/readline.html#IDX25

> If an attempt is made to set history-size to a non-numeric value, the maximum
> number of history entries will be set to 500.

https://github.com/ruby/reline/commit/acf0437280
2020-05-17 19:26:53 +09:00
aycabta 7a7854d8c1 Some I/O in test doesn't have "position"
Just returns column 1 for ambiguous width because this I/O is not tty and can't
seek.
2020-05-12 02:53:44 +09:00
aycabta 009092b04c [ruby/reline] Add URL reference of history-size
https://github.com/ruby/reline/commit/13420197b8
2020-04-29 19:13:14 +09:00
aycabta 213ebec7a7 [ruby/reline] Version 0.1.4
https://github.com/ruby/reline/commit/298144b06a
2020-04-29 19:13:14 +09:00
aycabta 4859352df6 [ruby/reline] Negative history_size means unlimited
And unlimited is default.

https://github.com/ruby/reline/commit/f5149c3ca6
2020-04-29 19:13:14 +09:00
aycabta d27fa87418 [ruby/reline] New items to history are dropped if history_size is zero
https://github.com/ruby/reline/commit/9bdbed9cbc
2020-04-29 19:13:14 +09:00
Nobuyoshi Nakada 0ac5009165 [ruby/reline] Ignore non-absolute XDG_CONFIG_HOME
https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
> All paths set in these environment variables must be absolute.
> If an implementation encounters a relative path in any of these
> variables it should consider the path invalid and ignore it.

https://github.com/ruby/reline/commit/45af6eea77
2020-04-29 19:13:14 +09:00
aycabta 9fb20711fd [ruby/reline] Treat home dir correctly
https://github.com/ruby/reline/commit/9b1327d2f4
2020-04-24 16:46:36 +09:00
aycabta 81b0b79197 [ruby/reline] Support XDG_CONFIG_HOME
In the XDG Specification, if ~/.config/readline/inputrc exists, then ~/.inputrc
should not be read, but for compatibility with GNU Readline, if ~/.inputrc
exists, then it is given priority.

https://github.com/ruby/reline/commit/97f1e7db04
2020-04-24 16:45:07 +09:00
aycabta db0d850d4e [ruby/reline] Add ed_search_next_history
https://github.com/ruby/reline/commit/ca750b676b
2020-04-18 23:12:52 +09:00
aycabta bea3e31e5f [ruby/reline] Add ed_search_prev_history
https://github.com/ruby/reline/commit/e9ae288825
2020-04-18 23:12:52 +09:00
aycabta 08c1c3f220 [ruby/reline] Use vi_search_{prev,next} to incremental search
https://github.com/ruby/reline/commit/cab312f584
2020-04-18 23:09:31 +09:00
aycabta afe997857e [ruby/reline] Rename search_history with incremental_search_history
https://github.com/ruby/reline/commit/d563063ea0
2020-04-18 23:09:31 +09:00
aycabta 90913bfabe [ruby/reline] Suppress error in case INPUTRC env is empty
https://github.com/ruby/reline/commit/bce7e7562b
2020-03-26 17:41:21 +09:00
aycabta f245fb1ab8 [ruby/reline] Work with wrong $/ value correctly
https://github.com/ruby/reline/commit/962ebf5a1b
2020-03-26 17:41:21 +09:00
aycabta 12ae7b3369 [ruby/reline] Version 0.1.3
https://github.com/ruby/reline/commit/ea2b182466
2020-02-15 21:52:03 +09:00
aycabta 2efb38e766 [ruby/reline] Use IO#write instead of IO#print
IO#print always adds a string of $\ automatically.

https://github.com/ruby/reline/commit/a93119c847
2020-02-14 22:47:27 +09:00
aycabta 97b583d68b [ruby/reline] Organize special keys escape sequences
https://github.com/ruby/reline/commit/41deb1a3d9
2020-02-09 02:54:41 +09:00
aycabta 06c37fa5b4 [ruby/reline] Bypass cursor down when a char is rendered at eol on Windows
A newline is automatically inserted if a character is rendered at eol on
Windows command prompt.

https://github.com/ruby/reline/commit/4bfea07e4a
2020-02-02 03:28:20 +09:00
aycabta 16d4774da1 [ruby/reline] Fix Reline::Windows#scroll_down
I mistook Right and Bottom.

https://github.com/ruby/reline/commit/8be401c5f5
2020-02-02 03:28:07 +09:00
aycabta 5d124a3b68 [ruby/reline] Support GNOME style Home/End key sequences [Bug #16510]
https://github.com/ruby/reline/commit/788f0df845
2020-01-29 15:11:59 +09:00
aycabta c257d81186 Always use UTF-8 for Reline::GeneralIO on Windows 2020-01-26 12:57:13 +09:00
Lars Kanis d1166c6d39 Reline: Use a more robust detection of MinTTY
The previous detection per get_screen_size fails when stdout is passed
to a pipe. That is the case when running ruby tests in parallel ("-j" switch).
In this case Reline believes that it's running on MinTTY and the tests
are running with ANSI IOGate instead of the Windows adapter on MINGW.
So parallel test results were different to that of a single process.
This commit fixes these differencies.

The code is taken from git sources and translated to ruby.
NtQueryObject() is replaced by GetFileInformationByHandleEx(), because
NtQueryObject() is undocumented and is more difficult to use:
  c5a03b1e29/compat/winansi.c (L558)
2020-01-21 21:26:58 +09:00
aycabta 2943ebd240 [ruby/reline] Implement vi_change_meta
https://github.com/ruby/reline/commit/8538e0e10f
2020-01-21 09:52:32 +09:00
aycabta 3b407abe9b [ruby/reline] Implement vi_prev_char and vi_to_prev_char
https://github.com/ruby/reline/commit/0ad3ee63fa
2020-01-20 19:13:19 +09:00
aycabta b17797a694 [ruby/reline] Implement vi_to_next_char
https://github.com/ruby/reline/commit/066ecb0a21
2020-01-20 19:13:19 +09:00
aycabta 800c2a8e4c Implement vi_insert_at_bol and vi_add_at_eol 2020-01-17 01:37:01 +09:00
aycabta f8ea2860b0 Introduce an abstracted structure about the encoding of Reline
The command prompt on Windows always uses Unicode to take input and print
output but most Reline implementation depends on Encoding.default_external.
This commit introduces an abstracted structure about the encoding of Reline.
2020-01-14 15:40:38 +09:00
aycabta 7392083c2f Support history-size in .inputrc correctly 2020-01-06 21:50:48 +09:00
aycabta 439e1ccd08 Complete indented and quoted string correctly
def foo
    ''.upca[TAB]

This will be completed to be:

  def foo
  ''.upcase

The indent was gone. This commit fixes the bug.
2020-01-06 01:20:24 +09:00
aycabta da028a4fbf Rescue EOFError
If C-d is pressed before IRB is ready, IRB crashes because EOFError occurs.
2020-01-05 22:48:39 +09:00
KOBAYASHI Shuji 9b928fa443 [ruby/reline] Sort completion list
#### Legacy mode:

  ```console
  $ irb --legacy
  irb(main):001:0> l[TAB][TAB]
  lambda           load             local_variables  loop
  ```

#### Before this patch:

  ```console
  $ irb
  irb(main):001:0> l[TAB][TAB]
  local_variables
  loop
  lambda
  load
  ```

#### After this patch:

  ```console
  $ irb
  irb(main):001:0> l[TAB][TAB]
  lambda
  load
  local_variables
  loop
  ```

https://github.com/ruby/reline/commit/6074069c7d
2020-01-05 11:28:01 +09:00
Yusuke Endoh 337ba56aff [ruby/reline] Degenerate the terminal size to [$LINES, $COLUMNS] if it is unknown
This is a workaround for https://github.com/ruby/irb/issues/50

https://github.com/ruby/reline/commit/5725677d1a
2019-12-31 23:32:24 +09:00
aycabta 778634f778 Drop an invalid char as UTF-8 2019-12-27 16:02:30 +09:00
aycabta e1e1d92277 [ruby/reline] Version 0.1.2
https://github.com/ruby/reline/commit/b41024e317
2019-12-25 18:47:47 +09:00
aycabta 8a705245e5 Save last breaking point to complete 2019-12-25 18:45:24 +09:00
aycabta 2462427008 [ruby/reline] Version 0.1.1
https://github.com/ruby/reline/commit/923f97d068
2019-12-25 10:08:39 +09:00
aycabta ed5b4bae6a The behavior of vi_end_of_transmission should be the same of vi_list_or_eof 2019-12-25 09:52:37 +09:00
aycabta 622e47a1db ^D on non-empty line in vi mode behaves like Enter 2019-12-25 09:34:13 +09:00
aycabta 7758849cb5 Remove unused variable 2019-12-24 18:39:48 +09:00
aycabta 42e2a322f1 The delete-char-or-list shows completed list when called at end of line
It doesn't behave the same as the delete-char.
2019-12-24 18:34:43 +09:00
aycabta 5e17834fc9 [ruby/reline] Version 0.1.0
https://github.com/ruby/reline/commit/55d4dfec1e
2019-12-24 09:56:40 +09:00
Nobuyoshi Nakada 679bc4f9cb [ruby/reline] Use IO#raw to read one byte
https://github.com/ruby/reline/commit/be17740e82
2019-12-23 02:11:22 +09:00