summaryrefslogtreecommitdiff
path: root/lib/reline
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2020-04-15 02:23:24 +0900
committeraycabta <aycabta@gmail.com>2020-04-18 23:09:31 +0900
commit08c1c3f2203592c219c6068ea05fb5d583493a25 (patch)
treef2bb16ff33bf8b2a3dd0bd8b66f9173f2cc782ef /lib/reline
parentafe997857ec69771078d04a7d4f9da784f478ad5 (diff)
[ruby/reline] Use vi_search_{prev,next} to incremental search
https://github.com/ruby/reline/commit/cab312f584
Diffstat (limited to 'lib/reline')
-rw-r--r--lib/reline/key_actor/emacs.rb12
-rw-r--r--lib/reline/key_actor/vi_command.rb4
-rw-r--r--lib/reline/key_actor/vi_insert.rb4
-rw-r--r--lib/reline/line_editor.rb8
4 files changed, 14 insertions, 14 deletions
diff --git a/lib/reline/key_actor/emacs.rb b/lib/reline/key_actor/emacs.rb
index 3886d17f22..1e51d4fa18 100644
--- a/lib/reline/key_actor/emacs.rb
+++ b/lib/reline/key_actor/emacs.rb
@@ -37,9 +37,9 @@ class Reline::KeyActor::Emacs < Reline::KeyActor::Base
# 17 ^Q
:ed_quoted_insert,
# 18 ^R
- :ed_search_prev_history,
+ :vi_search_prev,
# 19 ^S
- :ed_search_next_history,
+ :vi_search_next,
# 20 ^T
:ed_transpose_chars,
# 21 ^U
@@ -413,11 +413,11 @@ class Reline::KeyActor::Emacs < Reline::KeyActor::Base
# 205 M-M
:ed_unassigned,
# 206 M-N
- :ed_search_next_history,
+ :vi_search_next,
# 207 M-O
:ed_sequence_lead_in,
# 208 M-P
- :ed_search_prev_history,
+ :vi_search_prev,
# 209 M-Q
:ed_unassigned,
# 210 M-R
@@ -477,11 +477,11 @@ class Reline::KeyActor::Emacs < Reline::KeyActor::Base
# 237 M-m
:ed_unassigned,
# 238 M-n
- :ed_search_next_history,
+ :vi_search_next,
# 239 M-o
:ed_unassigned,
# 240 M-p
- :ed_search_prev_history,
+ :vi_search_prev,
# 241 M-q
:ed_unassigned,
# 242 M-r
diff --git a/lib/reline/key_actor/vi_command.rb b/lib/reline/key_actor/vi_command.rb
index 865dfa2e00..54b4a60383 100644
--- a/lib/reline/key_actor/vi_command.rb
+++ b/lib/reline/key_actor/vi_command.rb
@@ -37,7 +37,7 @@ class Reline::KeyActor::ViCommand < Reline::KeyActor::Base
# 17 ^Q
:ed_ignore,
# 18 ^R
- :ed_search_prev_history,
+ :vi_search_prev,
# 19 ^S
:ed_ignore,
# 20 ^T
@@ -151,7 +151,7 @@ class Reline::KeyActor::ViCommand < Reline::KeyActor::Base
# 74 J
:vi_join_lines,
# 75 K
- :ed_search_prev_history,
+ :vi_search_prev,
# 76 L
:ed_unassigned,
# 77 M
diff --git a/lib/reline/key_actor/vi_insert.rb b/lib/reline/key_actor/vi_insert.rb
index 06e94a9c30..b8e89f81d8 100644
--- a/lib/reline/key_actor/vi_insert.rb
+++ b/lib/reline/key_actor/vi_insert.rb
@@ -37,9 +37,9 @@ class Reline::KeyActor::ViInsert < Reline::KeyActor::Base
# 17 ^Q
:ed_ignore,
# 18 ^R
- :ed_search_prev_history,
+ :vi_search_prev,
# 19 ^S
- :ed_search_next_history,
+ :vi_search_next,
# 20 ^T
:ed_insert,
# 21 ^U
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb
index 0a72de1500..7097a3d878 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -1411,15 +1411,15 @@ class Reline::LineEditor
}
end
- private def ed_search_prev_history(key)
+ private def vi_search_prev(key)
incremental_search_history(key)
end
- alias_method :reverse_search_history, :ed_search_prev_history
+ alias_method :reverse_search_history, :vi_search_prev
- private def ed_search_next_history(key)
+ private def vi_search_next(key)
incremental_search_history(key)
end
- alias_method :forward_search_history, :ed_search_next_history
+ alias_method :forward_search_history, :vi_search_next
private def ed_prev_history(key, arg: 1)
if @is_multiline and @line_index > 0