aboutsummaryrefslogtreecommitdiffstats
path: root/lib/reline.rb
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2019-12-03 01:17:07 +0900
committeraycabta <aycabta@gmail.com>2019-12-03 01:39:59 +0900
commita92560132b1bff6a01782cfeacd62756b4b34d21 (patch)
tree240caff6dba5dabc52823ab7cb13e7c707ef21ce /lib/reline.rb
parentbce38f706e9c434d8fd7c0e2e14bb4acdd085777 (diff)
downloadruby-a92560132b1bff6a01782cfeacd62756b4b34d21.tar.gz
Support incremental search by last determined word
In the incremental search by C-r, search word is saved when it's determined. In the next incremental search by C-r, if a user presses C-r again with the empty search word, the determined previous search word is used to search.
Diffstat (limited to 'lib/reline.rb')
-rw-r--r--lib/reline.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/reline.rb b/lib/reline.rb
index 7352d1a625..229c41a9a8 100644
--- a/lib/reline.rb
+++ b/lib/reline.rb
@@ -40,6 +40,7 @@ module Reline
attr_accessor :key_stroke
attr_accessor :line_editor
attr_accessor :ambiguous_width
+ attr_accessor :last_incremental_search
attr_reader :output
def initialize
@@ -367,6 +368,8 @@ module Reline
def_single_delegator :line_editor, :rerender, :redisplay
def_single_delegators :core, :vi_editing_mode?, :emacs_editing_mode?
def_single_delegators :core, :ambiguous_width
+ def_single_delegators :core, :last_incremental_search
+ def_single_delegators :core, :last_incremental_search=
def_single_delegators :core, :readmultiline
def_instance_delegators self, :readmultiline