Method: Textbringer::Commands#isearch_mode

Defined in:
lib/textbringer/commands/isearch.rb

#isearch_mode(forward, recursive_edit: false) ⇒ Object



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/textbringer/commands/isearch.rb', line 45

def isearch_mode(forward, recursive_edit: false)
  ISEARCH_STATUS[:forward] = forward
  ISEARCH_STATUS[:string] = +""
  ISEARCH_STATUS[:recursive_edit] = recursive_edit
  Controller.current.overriding_map = ISEARCH_MODE_MAP
  run_hooks(:isearch_mode_hook)
  add_hook(:pre_command_hook, :isearch_pre_command_hook)
  ISEARCH_STATUS[:start] = ISEARCH_STATUS[:last_pos] = Buffer.current.point
  if Buffer.current != Buffer.minibuffer
    message(isearch_prompt, log: false)
  end
  if recursive_edit
    recursive_edit()
  end
end