Skip to content

Commit

Permalink
Use vi_search_{prev,next} to incremental search
Browse files Browse the repository at this point in the history
  • Loading branch information
aycabta committed Apr 14, 2020
1 parent d563063 commit cab312f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions lib/reline/key_actor/emacs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/reline/key_actor/vi_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/reline/key_actor/vi_insert.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions lib/reline/line_editor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1411,15 +1411,15 @@ def finish
}
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
Expand Down

0 comments on commit cab312f

Please sign in to comment.