/External.LCA_RESTRICTED/Languages/Ruby/ruby19/lib/ruby/site_ruby/1.9.1/rbreadline.rb
Ruby | 8664 lines | 6081 code | 1132 blank | 1451 comment | 1492 complexity | f47b1b860555f8d12b5502f59f11cbf8 MD5 | raw file
Possible License(s): AGPL-3.0, LGPL-2.1, Apache-2.0, ISC, GPL-2.0, CPL-1.0, MPL-2.0-no-copyleft-exception, BSD-3-Clause
Large files files are truncated, but you can click here to view the full file
- # rbreadline.rb -- a general facility for reading lines of input
- # with emacs style editing and completion.
-
- #
- # Inspired by GNU Readline, translation to Ruby
- # Copyright (C) 2009 by Park Heesob phasis@gmail.com
- #
-
- class Fixnum
- def ord; self; end
- end
-
- module RbReadline
- require 'etc'
-
- RL_LIBRARY_VERSION = "5.2"
- RL_READLINE_VERSION = 0x0502
- RB_READLINE_VERSION = "0.2.0"
-
- EOF = "\xFF"
- ESC = "\C-["
- PAGE = "\C-L"
- SPACE = "\x20"
- RETURN = "\C-M"
- ABORT_CHAR = "\C-G"
- TAB = "\t"
- RUBOUT = "x7f"
- NEWLINE = "\n"
-
- DEFAULT_BUFFER_SIZE = 256
- DEFAULT_MAX_KILLS = 10
-
- MB_FIND_NONZERO = 1
- MB_FIND_ANY = 0
- MB_LEN_MAX = 4
-
- DEFAULT_INPUTRC = "~/.inputrc"
- SYS_INPUTRC = "/etc/inputrc"
-
- UpCase = 1
- DownCase = 2
- CapCase = 3
-
- # Possible history errors passed to hist_error.
- EVENT_NOT_FOUND = 0
- BAD_WORD_SPEC = 1
- SUBST_FAILED = 2
- BAD_MODIFIER = 3
- NO_PREV_SUBST = 4
-
- # Possible definitions for history starting point specification.
- ANCHORED_SEARCH = 1
- NON_ANCHORED_SEARCH = 0
-
- # Possible definitions for what style of writing the history file we want.
- HISTORY_APPEND = 0
- HISTORY_OVERWRITE = 1
-
- # Input error; can be returned by (*rl_getc_function) if readline is reading
- # a top-level command (RL_ISSTATE (RL_STATE_READCMD)).
- READERR = 0xFE.chr
-
- # Definitions available for use by readline clients.
- RL_PROMPT_START_IGNORE = 1.chr
- RL_PROMPT_END_IGNORE = 2.chr
-
- # Possible values for do_replace argument to rl_filename_quoting_function,
- # called by rl_complete_internal.
- NO_MATCH = 0
- SINGLE_MATCH = 1
- MULT_MATCH = 2
-
- # Callback data for reading numeric arguments
- NUM_SAWMINUS = 0x01
- NUM_SAWDIGITS = 0x02
- NUM_READONE = 0x04
-
- # A context for reading key sequences longer than a single character when
- # using the callback interface.
- KSEQ_DISPATCHED = 0x01
- KSEQ_SUBSEQ = 0x02
- KSEQ_RECURSIVE = 0x04
-
- # Possible state values for rl_readline_state
- RL_STATE_NONE = 0x000000 # no state before first call
-
- RL_STATE_INITIALIZING = 0x000001 # initializing
- RL_STATE_INITIALIZED = 0x000002 # initialization done
- RL_STATE_TERMPREPPED = 0x000004 # terminal is prepped
- RL_STATE_READCMD = 0x000008 # reading a command key
- RL_STATE_METANEXT = 0x000010 # reading input after ESC
- RL_STATE_DISPATCHING = 0x000020 # dispatching to a command
- RL_STATE_MOREINPUT = 0x000040 # reading more input in a command function
- RL_STATE_ISEARCH = 0x000080 # doing incremental search
- RL_STATE_NSEARCH = 0x000100 # doing non-inc search
- RL_STATE_SEARCH = 0x000200 # doing a history search
- RL_STATE_NUMERICARG = 0x000400 # reading numeric argument
- RL_STATE_MACROINPUT = 0x000800 # getting input from a macro
- RL_STATE_MACRODEF = 0x001000 # defining keyboard macro
- RL_STATE_OVERWRITE = 0x002000 # overwrite mode
- RL_STATE_COMPLETING = 0x004000 # doing completion
- RL_STATE_SIGHANDLER = 0x008000 # in readline sighandler
- RL_STATE_UNDOING = 0x010000 # doing an undo
- RL_STATE_INPUTPENDING = 0x020000 # rl_execute_next called
- RL_STATE_TTYCSAVED = 0x040000 # tty special chars saved
- RL_STATE_CALLBACK = 0x080000 # using the callback interface
- RL_STATE_VIMOTION = 0x100000 # reading vi motion arg
- RL_STATE_MULTIKEY = 0x200000 # reading multiple-key command
- RL_STATE_VICMDONCE = 0x400000 # entered vi command mode at least once
-
- RL_STATE_DONE = 0x800000 # done accepted line
-
- NO_BELL = 0
- AUDIBLE_BELL = 1
- VISIBLE_BELL = 2
- # The actions that undo knows how to undo. Notice that UNDO_DELETE means
- # to insert some text, and UNDO_INSERT means to delete some text. I.e.,
- # the code tells undo what to undo, not how to undo it.
- UNDO_DELETE, UNDO_INSERT, UNDO_BEGIN, UNDO_END = 0,1,2,3
-
- # Definitions used when searching the line for characters.
- # NOTE: it is necessary that opposite directions are inverses
- FTO = 1 # forward to
- BTO = -1 # backward to
- FFIND = 2 # forward find
- BFIND = -2 # backward find
-
- # Possible values for the found_quote flags word used by the completion
- # functions. It says what kind of (shell-like) quoting we found anywhere
- # in the line.
- RL_QF_SINGLE_QUOTE = 0x01
- RL_QF_DOUBLE_QUOTE = 0x02
- RL_QF_BACKSLASH = 0x04
- RL_QF_OTHER_QUOTE = 0x08
-
- KEYMAP_SIZE = 257
- ANYOTHERKEY = KEYMAP_SIZE-1
-
- @hConsoleHandle = nil
- @MessageBeep = nil
-
- RL_IM_INSERT = 1
- RL_IM_OVERWRITE = 0
- RL_IM_DEFAULT = RL_IM_INSERT
- @no_mode = -1
- @vi_mode = 0
- @emacs_mode = 1
- ISFUNC = 0
- ISKMAP = 1
- ISMACR = 2
-
- HISTORY_WORD_DELIMITERS = " \t\n;&()|<>"
- HISTORY_QUOTE_CHARACTERS = "\"'`"
-
- RL_SEARCH_ISEARCH = 0x01 # incremental search
- RL_SEARCH_NSEARCH = 0x02 # non-incremental search
- RL_SEARCH_CSEARCH = 0x04 # intra-line char search
-
- # search flags
- SF_REVERSE = 0x01
- SF_FOUND = 0x02
- SF_FAILED = 0x04
-
- @slashify_in_quotes = "\\`\"$"
-
- @sigint_proc = nil
- @sigint_blocked = false
-
- @rl_prep_term_function = :rl_prep_terminal
- @rl_deprep_term_function = :rl_deprep_terminal
-
- @_rl_history_saved_point = -1
-
- @rl_max_kills = DEFAULT_MAX_KILLS
- @rl_kill_ring = nil
- @rl_kill_index = 0
- @rl_kill_ring_length = 0
-
- @pending_bytes = ''
- @stored_count = 0
-
- @_rl_isearch_terminators = nil
- @_rl_iscxt = nil
- @last_isearch_string = nil
- @last_isearch_string_len = 0
- @default_isearch_terminators = "\033\012"
- @_rl_history_preserve_point = false
- @terminal_prepped = false
- @otio = nil
-
- @msg_saved_prompt = false
-
- @_rl_nscxt = nil
- @noninc_search_string = nil
- @noninc_history_pos = 0
- @prev_line_found = nil
-
- rl_history_search_len = 0
- rl_history_search_pos = 0
- history_search_string = nil
- history_string_size = 0
-
- @_rl_tty_chars = Struct.new(:t_eol,:t_eol2,:t_erase,:t_werase,:t_kill,:t_reprint,:t_intr,:t_eof,
- :t_quit,:t_susp,:t_dsusp,:t_start,:t_stop,:t_lnext,:t_flush,:t_status).new
- @_rl_last_tty_chars = nil
-
- # Variables exported by this file.
- # The character that represents the start of a history expansion
- # request. This is usually `!'.
- @history_expansion_char = ?!
-
- # The character that invokes word substitution if found at the start of
- # a line. This is usually `^'.
- @history_subst_char = ?^
-
- # During tokenization, if this character is seen as the first character
- # of a word, then it, and all subsequent characters upto a newline are
- # ignored. For a Bourne shell, this should be '#'. Bash special cases
- # the interactive comment character to not be a comment delimiter.
- @history_comment_char = ?\0
-
- # The list of characters which inhibit the expansion of text if found
- # immediately following history_expansion_char.
- @history_no_expand_chars = " \t\n\r="
-
- # If set to a non-zero value, single quotes inhibit history expansion.
- # The default is 0.
- @history_quotes_inhibit_expansion = 0
-
- # Used to split words by history_tokenize_internal.
- @history_word_delimiters = HISTORY_WORD_DELIMITERS
-
- # If set, this points to a function that is called to verify that a
- # particular history expansion should be performed.
- @history_inhibit_expansion_function = nil
-
- @rl_event_hook = nil
- # The visible cursor position. If you print some text, adjust this.
- # NOTE: _rl_last_c_pos is used as a buffer index when not in a locale
- # supporting multibyte characters, and an absolute cursor position when
- # in such a locale. This is an artifact of the donated multibyte support.
- # Care must be taken when modifying its value.
- @_rl_last_c_pos = 0
- @_rl_last_v_pos = 0
-
- @cpos_adjusted = false
- @cpos_buffer_position = 0
-
- # Number of lines currently on screen minus 1.
- @_rl_vis_botlin = 0
-
- # Variables used only in this file.
- # The last left edge of text that was displayed. This is used when
- # doing horizontal scrolling. It shifts in thirds of a screenwidth.
- @last_lmargin = 0
-
- # The line display buffers. One is the line currently displayed on
- # the screen. The other is the line about to be displayed.
- @visible_line = nil
- @invisible_line = nil
-
- # A buffer for `modeline' messages.
- @msg_buf = 0.chr * 128
-
- # Non-zero forces the redisplay even if we thought it was unnecessary.
- @forced_display = false
-
- # Default and initial buffer size. Can grow.
- @line_size = 1024
-
- # Variables to keep track of the expanded prompt string, which may
- # include invisible characters.
-
- @local_prompt = nil
- @local_prompt_prefix = nil
- @local_prompt_len = 0
- @prompt_visible_length = 0
- @prompt_prefix_length = 0
-
- # The number of invisible characters in the line currently being
- # displayed on the screen.
- @visible_wrap_offset = 0
-
- # The number of invisible characters in the prompt string. Static so it
- # can be shared between rl_redisplay and update_line
- @wrap_offset = 0
-
- @prompt_last_invisible = 0
-
- # The length (buffer offset) of the first line of the last (possibly
- # multi-line) buffer displayed on the screen.
- @visible_first_line_len = 0
-
- # Number of invisible characters on the first physical line of the prompt.
- # Only valid when the number of physical characters in the prompt exceeds
- # (or is equal to) _rl_screenwidth.
- @prompt_invis_chars_first_line = 0
-
- @prompt_last_screen_line = 0
-
- @prompt_physical_chars = 0
-
- # Variables to save and restore prompt and display information.
-
- # These are getting numerous enough that it's time to create a struct.
-
- @saved_local_prompt = nil
- @saved_local_prefix = nil
- @saved_last_invisible = 0
- @saved_visible_length = 0
- @saved_prefix_length = 0
- @saved_local_length = 0
- @saved_invis_chars_first_line = 0
- @saved_physical_chars = 0
-
- @inv_lbreaks = nil
- @vis_lbreaks = nil
- @_rl_wrapped_line = nil
-
- @term_buffer = nil
- @term_string_buffer = nil
-
- @tcap_initialized = false
-
- # While we are editing the history, this is the saved
- # version of the original line.
- @_rl_saved_line_for_history = nil
-
- # An array of HIST_ENTRY. This is where we store the history.
- @the_history = nil
- @history_base = 1
-
- # Non-zero means that we have enforced a limit on the amount of
- # history that we save.
- @history_stifled = false
-
- # If HISTORY_STIFLED is non-zero, then this is the maximum number of
- # entries to remember.
- @history_max_entries = 0
- @max_input_history = 0 # backwards compatibility
-
- # The current location of the interactive history pointer. Just makes
- # life easier for outside callers.
- @history_offset = 0
-
- # The number of strings currently stored in the history list.
- @history_length = 0
-
- @_rl_vi_last_command = 'i' # default `.' puts you in insert mode
-
- # Non-zero means enter insertion mode.
- @_rl_vi_doing_insert = 0
-
- # Command keys which do movement for xxx_to commands.
- @vi_motion = " hl^$0ftFT;,%wbeWBE|"
-
- # Keymap used for vi replace characters. Created dynamically since
- # rarely used.
- @vi_replace_map = nil
-
- # The number of characters inserted in the last replace operation.
- @vi_replace_count = 0
-
- # If non-zero, we have text inserted after a c[motion] command that put
- # us implicitly into insert mode. Some people want this text to be
- # attached to the command so that it is `redoable' with `.'.
- @vi_continued_command = false
- @vi_insert_buffer = nil
- @vi_insert_buffer_size = 0
-
- @_rl_vi_last_repeat = 1
- @_rl_vi_last_arg_sign = 1
- @_rl_vi_last_motion = 0
- @_rl_vi_last_search_char = 0
- @_rl_vi_last_replacement = 0
-
- @_rl_vi_last_key_before_insert = 0
-
- @vi_redoing = 0
-
- # Text modification commands. These are the `redoable' commands.
- @vi_textmod = "_*\\AaIiCcDdPpYyRrSsXx~"
-
- # Arrays for the saved marks.
- @vi_mark_chars = Array.new(26,-1)
-
- @emacs_standard_keymap = {
- "\C-@" => :rl_set_mark ,
- "\C-a" => :rl_beg_of_line ,
- "\C-b" => :rl_backward_char ,
- "\C-d" => :rl_delete ,
- "\C-e" => :rl_end_of_line ,
- "\C-f" => :rl_forward_char ,
- "\C-g" => :rl_abort ,
- "\C-h" => :rl_rubout ,
- "\C-i" => :rl_complete ,
- "\C-j" => :rl_newline ,
- "\C-k" => :rl_kill_line ,
- "\C-l" => :rl_clear_screen ,
- "\C-m" => :rl_newline ,
- "\C-n" => :rl_get_next_history ,
- "\C-p" => :rl_get_previous_history ,
- "\C-q" => :rl_quoted_insert ,
- "\C-r" => :rl_reverse_search_history ,
- "\C-s" => :rl_forward_search_history ,
- "\C-t" => :rl_transpose_chars ,
- "\C-u" => :rl_unix_line_discard ,
- "\C-v" => :rl_quoted_insert ,
- "\C-w" => :rl_unix_word_rubout ,
- "\C-y" => :rl_yank ,
- "\C-]" => :rl_char_search ,
- "\C-_" => :rl_undo_command ,
- "\x7F" => :rl_rubout ,
- "\e\C-g" => :rl_abort ,
- "\e\C-h" => :rl_backward_kill_word ,
- "\e\C-i" => :rl_tab_insert ,
- "\e\C-j" => :rl_vi_editing_mode ,
- "\e\C-m" => :rl_vi_editing_mode ,
- "\e\C-r" => :rl_revert_line ,
- "\e\C-y" => :rl_yank_nth_arg ,
- "\e\C-[" => :rl_complete ,
- "\e\C-]" => :rl_backward_char_search ,
- "\e " => :rl_set_mark ,
- "\e#" => :rl_insert_comment ,
- "\e&" => :rl_tilde_expand ,
- "\e*" => :rl_insert_completions ,
- "\e-" => :rl_digit_argument ,
- "\e." => :rl_yank_last_arg ,
- "\e0" => :rl_digit_argument ,
- "\e1" => :rl_digit_argument ,
- "\e2" => :rl_digit_argument ,
- "\e3" => :rl_digit_argument ,
- "\e4" => :rl_digit_argument ,
- "\e5" => :rl_digit_argument ,
- "\e6" => :rl_digit_argument ,
- "\e7" => :rl_digit_argument ,
- "\e8" => :rl_digit_argument ,
- "\e9" => :rl_digit_argument ,
- "\e<" => :rl_beginning_of_history ,
- "\e=" => :rl_possible_completions ,
- "\e>" => :rl_end_of_history ,
- "\e?" => :rl_possible_completions ,
- "\eB" => :rl_backward_word ,
- "\eC" => :rl_capitalize_word ,
- "\eD" => :rl_kill_word ,
- "\eF" => :rl_forward_word ,
- "\eL" => :rl_downcase_word ,
- "\eN" => :rl_noninc_forward_search ,
- "\eP" => :rl_noninc_reverse_search ,
- "\eR" => :rl_revert_line ,
- "\eT" => :rl_transpose_words ,
- "\eU" => :rl_upcase_word ,
- "\eY" => :rl_yank_pop ,
- "\e\\" => :rl_delete_horizontal_space ,
- "\e_" => :rl_yank_last_arg ,
- "\eb" => :rl_backward_word ,
- "\ec" => :rl_capitalize_word ,
- "\ed" => :rl_kill_word ,
- "\ef" => :rl_forward_word ,
- "\el" => :rl_downcase_word ,
- "\en" => :rl_noninc_forward_search ,
- "\ep" => :rl_noninc_reverse_search ,
- "\er" => :rl_revert_line ,
- "\et" => :rl_transpose_words ,
- "\eu" => :rl_upcase_word ,
- "\ey" => :rl_yank_pop ,
- "\e~" => :rl_tilde_expand ,
- "\377" => :rl_backward_kill_word ,
-
- "\C-x\C-g" => :rl_abort ,
- "\C-x\C-r" => :rl_re_read_init_file ,
- "\C-x\C-u" => :rl_undo_command ,
- "\C-x\C-x" => :rl_exchange_point_and_mark ,
- "\C-x(" => :rl_start_kbd_macro ,
- "\C-x)" => :rl_end_kbd_macro ,
- "\C-xE" => :rl_call_last_kbd_macro ,
- "\C-xe" => :rl_call_last_kbd_macro ,
- "\C-x\x7F" => :rl_backward_kill_line
- }
-
- @vi_movement_keymap = {
- "\C-d" => :rl_vi_eof_maybe ,
- "\C-e" => :rl_emacs_editing_mode ,
- "\C-g" => :rl_abort ,
- "\C-h" => :rl_backward_char ,
- "\C-j" => :rl_newline ,
- "\C-k" => :rl_kill_line ,
- "\C-l" => :rl_clear_screen ,
- "\C-m" => :rl_newline ,
- "\C-n" => :rl_get_next_history ,
- "\C-p" => :rl_get_previous_history ,
- "\C-q" => :rl_quoted_insert ,
- "\C-r" => :rl_reverse_search_history ,
- "\C-s" => :rl_forward_search_history ,
- "\C-t" => :rl_transpose_chars ,
- "\C-u" => :rl_unix_line_discard ,
- "\C-v" => :rl_quoted_insert ,
- "\C-w" => :rl_unix_word_rubout ,
- "\C-y" => :rl_yank ,
- "\C-_" => :rl_vi_undo ,
- " " => :rl_forward_char ,
- "#" => :rl_insert_comment ,
- "$" => :rl_end_of_line ,
- "%" => :rl_vi_match ,
- "&" => :rl_vi_tilde_expand ,
- "*" => :rl_vi_complete ,
- "+" => :rl_get_next_history ,
- "," => :rl_vi_char_search ,
- "-" => :rl_get_previous_history ,
- "." => :rl_vi_redo ,
- "/" => :rl_vi_search ,
- "0" => :rl_beg_of_line ,
- "1" => :rl_vi_arg_digit ,
- "2" => :rl_vi_arg_digit ,
- "3" => :rl_vi_arg_digit ,
- "4" => :rl_vi_arg_digit ,
- "5" => :rl_vi_arg_digit ,
- "6" => :rl_vi_arg_digit ,
- "7" => :rl_vi_arg_digit ,
- "8" => :rl_vi_arg_digit ,
- "9" => :rl_vi_arg_digit ,
- "" => :rl_vi_char_search ,
- "=" => :rl_vi_complete ,
- "?" => :rl_vi_search ,
- "A" => :rl_vi_append_eol ,
- "B" => :rl_vi_prev_word ,
- "C" => :rl_vi_change_to ,
- "D" => :rl_vi_delete_to ,
- "E" => :rl_vi_end_word ,
- "F" => :rl_vi_char_search ,
- "G" => :rl_vi_fetch_history ,
- "I" => :rl_vi_insert_beg ,
- "N" => :rl_vi_search_again ,
- "P" => :rl_vi_put ,
- "R" => :rl_vi_replace ,
- "S" => :rl_vi_subst ,
- "T" => :rl_vi_char_search ,
- "U" => :rl_revert_line ,
- "W" => :rl_vi_next_word ,
- "X" => :rl_vi_rubout ,
- "Y" => :rl_vi_yank_to ,
- "\\" => :rl_vi_complete ,
- "^" => :rl_vi_first_print ,
- "_" => :rl_vi_yank_arg ,
- "`" => :rl_vi_goto_mark ,
- "a" => :rl_vi_append_mode ,
- "b" => :rl_vi_prev_word ,
- "c" => :rl_vi_change_to ,
- "d" => :rl_vi_delete_to ,
- "e" => :rl_vi_end_word ,
- "f" => :rl_vi_char_search ,
- "h" => :rl_backward_char ,
- "i" => :rl_vi_insertion_mode ,
- "j" => :rl_get_next_history ,
- "k" => :rl_get_previous_history ,
- "l" => :rl_forward_char ,
- "m" => :rl_vi_set_mark ,
- "n" => :rl_vi_search_again ,
- "p" => :rl_vi_put ,
- "r" => :rl_vi_change_char ,
- "s" => :rl_vi_subst ,
- "t" => :rl_vi_char_search ,
- "u" => :rl_vi_undo ,
- "w" => :rl_vi_next_word ,
- "x" => :rl_vi_delete ,
- "y" => :rl_vi_yank_to ,
- "|" => :rl_vi_column ,
- "~" => :rl_vi_change_case
- }
-
- @vi_insertion_keymap = {
- "\C-a" => :rl_insert ,
- "\C-b" => :rl_insert ,
- "\C-c" => :rl_insert ,
- "\C-d" => :rl_vi_eof_maybe ,
- "\C-e" => :rl_insert ,
- "\C-f" => :rl_insert ,
- "\C-g" => :rl_insert ,
- "\C-h" => :rl_rubout ,
- "\C-i" => :rl_complete ,
- "\C-j" => :rl_newline ,
- "\C-k" => :rl_insert ,
- "\C-l" => :rl_insert ,
- "\C-m" => :rl_newline ,
- "\C-n" => :rl_insert ,
- "\C-o" => :rl_insert ,
- "\C-p" => :rl_insert ,
- "\C-q" => :rl_insert ,
- "\C-r" => :rl_reverse_search_history ,
- "\C-s" => :rl_forward_search_history ,
- "\C-t" => :rl_transpose_chars ,
- "\C-u" => :rl_unix_line_discard ,
- "\C-v" => :rl_quoted_insert ,
- "\C-w" => :rl_unix_word_rubout ,
- "\C-x" => :rl_insert ,
- "\C-y" => :rl_yank ,
- "\C-z" => :rl_insert ,
- "\C-[" => :rl_vi_movement_mode ,
- "\C-\\" => :rl_insert ,
- "\C-]" => :rl_insert ,
- "\C-^" => :rl_insert ,
- "\C-_" => :rl_vi_undo ,
- "\x7F" => :rl_rubout
- }
-
- @rl_library_version = RL_LIBRARY_VERSION
-
- @rl_readline_version = RL_READLINE_VERSION
-
- @rl_readline_name = "other"
-
- @rl_getc_function = :rl_getc
-
- # Non-zero tells rl_delete_text and rl_insert_text to not add to
- # the undo list.
- @_rl_doing_an_undo = false
-
- # How many unclosed undo groups we currently have.
- @_rl_undo_group_level = 0
-
- # The current undo list for THE_LINE.
- @rl_undo_list = nil
-
- # Application-specific redisplay function.
- @rl_redisplay_function = :rl_redisplay
-
- # Global variables declared here.
- # What YOU turn on when you have handled all redisplay yourself.
- @rl_display_fixed = false
-
- @_rl_suppress_redisplay = 0
- @_rl_want_redisplay = false
-
- # The stuff that gets printed out before the actual text of the line.
- # This is usually pointing to rl_prompt.
- @rl_display_prompt = nil
-
- # True if this is `real' readline as opposed to some stub substitute.
- @rl_gnu_readline_p = true
-
- for i in 32 .. 255
- @emacs_standard_keymap[i.chr] = :rl_insert unless @emacs_standard_keymap[i.chr]
- @vi_insertion_keymap[i.chr] = :rl_insert unless @vi_insertion_keymap[i.chr]
- end
- # A pointer to the keymap that is currently in use.
- # By default, it is the standard emacs keymap.
- @_rl_keymap = @emacs_standard_keymap
-
-
- # The current style of editing.
- @rl_editing_mode = @emacs_mode
-
- # The current insert mode: input (the default) or overwrite
- @rl_insert_mode = RL_IM_DEFAULT
-
- # Non-zero if we called this function from _rl_dispatch(). It's present
- # so functions can find out whether they were called from a key binding
- # or directly from an application.
- @rl_dispatching = false
-
- # Non-zero if the previous command was a kill command.
- @_rl_last_command_was_kill = false
-
- # The current value of the numeric argument specified by the user.
- @rl_numeric_arg = 1
-
- # Non-zero if an argument was typed.
- @rl_explicit_arg = false
-
- # Temporary value used while generating the argument.
- @rl_arg_sign = 1
-
- # Non-zero means we have been called at least once before.
- @rl_initialized = false
-
- # Flags word encapsulating the current readline state.
- @rl_readline_state = RL_STATE_NONE
-
- # The current offset in the current input line.
- @rl_point = 0
-
- # Mark in the current input line.
- @rl_mark = 0
-
- # Length of the current input line.
- @rl_end = 0
-
- # Make this non-zero to return the current input_line.
- @rl_done = false
-
- # The last function executed by readline.
- @rl_last_func = nil
-
- # Top level environment for readline_internal ().
- @readline_top_level = nil
-
- # The streams we interact with.
- @_rl_in_stream = nil
- @_rl_out_stream = nil
-
- # The names of the streams that we do input and output to.
- @rl_instream = nil
- @rl_outstream = nil
-
- @pop_index = 0
- @push_index = 0
- @ibuffer = 0.chr * 512
- @ibuffer_len = @ibuffer.length - 1
-
-
- # Non-zero means echo characters as they are read. Defaults to no echo
- # set to 1 if there is a controlling terminal, we can get its attributes,
- # and the attributes include `echo'. Look at rltty.c:prepare_terminal_settings
- # for the code that sets it.
- @readline_echoing_p = false
-
- # Current prompt.
- @rl_prompt = nil
- @rl_visible_prompt_length = 0
-
- # Set to non-zero by calling application if it has already printed rl_prompt
- # and does not want readline to do it the first time.
- @rl_already_prompted = false
-
- # The number of characters read in order to type this complete command.
- @rl_key_sequence_length = 0
-
- # If non-zero, then this is the address of a function to call just
- # before readline_internal_setup () prints the first prompt.
- @rl_startup_hook = nil
-
- # If non-zero, this is the address of a function to call just before
- # readline_internal_setup () returns and readline_internal starts
- # reading input characters.
- @rl_pre_input_hook = nil
-
- # The character that can generate an EOF. Really read from
- # the terminal driver... just defaulted here.
- @_rl_eof_char = "\cD"
-
- # Non-zero makes this the next keystroke to read.
- @rl_pending_input = 0
-
- # Pointer to a useful terminal name.
- @rl_terminal_name = nil
-
- # Non-zero means to always use horizontal scrolling in line display.
- @_rl_horizontal_scroll_mode = false
-
- # Non-zero means to display an asterisk at the starts of history lines
- # which have been modified.
- @_rl_mark_modified_lines = false
-
- # The style of `bell' notification preferred. This can be set to NO_BELL,
- # AUDIBLE_BELL, or VISIBLE_BELL.
- @_rl_bell_preference = AUDIBLE_BELL
-
- # String inserted into the line by rl_insert_comment ().
- @_rl_comment_begin = nil
-
- # Keymap holding the function currently being executed.
- @rl_executing_keymap = nil
-
- # Keymap we're currently using to dispatch.
- @_rl_dispatching_keymap = nil
-
- # Non-zero means to erase entire line, including prompt, on empty input lines.
- @rl_erase_empty_line = false
-
- # Non-zero means to read only this many characters rather than up to a
- # character bound to accept-line.
- @rl_num_chars_to_read = 0
-
- # Line buffer and maintenence.
- @rl_line_buffer = nil
-
- # Key sequence `contexts'
- @_rl_kscxt = nil
-
- # Non-zero means do not parse any lines other than comments and
- # parser directives.
- @_rl_parsing_conditionalized_out = false
-
- # Non-zero means to convert characters with the meta bit set to
- # escape-prefixed characters so we can indirect through
- # emacs_meta_keymap or vi_escape_keymap.
- @_rl_convert_meta_chars_to_ascii = true
-
- # Non-zero means to output characters with the meta bit set directly
- # rather than as a meta-prefixed escape sequence.
- @_rl_output_meta_chars = false
-
- # Non-zero means to look at the termios special characters and bind
- # them to equivalent readline functions at startup.
- @_rl_bind_stty_chars = true
-
- @rl_completion_display_matches_hook = nil
-
- XOK = 1
-
- @_rl_term_clreol = nil
- @_rl_term_clrpag = nil
- @_rl_term_cr = nil
- @_rl_term_backspace = nil
- @_rl_term_goto = nil
- @_rl_term_pc = nil
-
- # Non-zero if we determine that the terminal can do character insertion.
- @_rl_terminal_can_insert = false
-
- # How to insert characters.
- @_rl_term_im = nil
- @_rl_term_ei = nil
- @_rl_term_ic = nil
- @_rl_term_ip = nil
- @_rl_term_IC = nil
-
- # How to delete characters.
- @_rl_term_dc = nil
- @_rl_term_DC = nil
-
- @_rl_term_forward_char = nil
-
- # How to go up a line.
- @_rl_term_up = nil
-
- # A visible bell; char if the terminal can be made to flash the screen.
- @_rl_visible_bell = nil
-
- # Non-zero means the terminal can auto-wrap lines.
- @_rl_term_autowrap = true
-
- # Non-zero means that this terminal has a meta key.
- @term_has_meta = 0
-
- # The sequences to write to turn on and off the meta key, if this
- # terminal has one.
- @_rl_term_mm = nil
- @_rl_term_mo = nil
-
- # The key sequences output by the arrow keys, if this terminal has any.
- @_rl_term_ku = nil
- @_rl_term_kd = nil
- @_rl_term_kr = nil
- @_rl_term_kl = nil
-
- # How to initialize and reset the arrow keys, if this terminal has any.
- @_rl_term_ks = nil
- @_rl_term_ke = nil
-
- # The key sequences sent by the Home and End keys, if any.
- @_rl_term_kh = nil
- @_rl_term_kH = nil
- @_rl_term_at7 = nil
-
- # Delete key
- @_rl_term_kD = nil
-
- # Insert key
- @_rl_term_kI = nil
-
- # Cursor control
- @_rl_term_vs = nil # very visible
- @_rl_term_ve = nil # normal
-
- # Variables that hold the screen dimensions, used by the display code.
- @_rl_screenwidth = @_rl_screenheight = @_rl_screenchars = 0
-
- # Non-zero means the user wants to enable the keypad.
- @_rl_enable_keypad = false
-
- # Non-zero means the user wants to enable a meta key.
- @_rl_enable_meta = true
-
- # ****************************************************************
- #
- # Completion matching, from readline's point of view.
- #
- # ****************************************************************
-
- # Variables known only to the readline library.
-
- # If non-zero, non-unique completions always show the list of matches.
- @_rl_complete_show_all = false
-
- # If non-zero, non-unique completions show the list of matches, unless it
- # is not possible to do partial completion and modify the line.
- @_rl_complete_show_unmodified = false
-
- # If non-zero, completed directory names have a slash appended.
- @_rl_complete_mark_directories = true
-
- # If non-zero, the symlinked directory completion behavior introduced in
- # readline-4.2a is disabled, and symlinks that point to directories have
- # a slash appended (subject to the value of _rl_complete_mark_directories).
- # This is user-settable via the mark-symlinked-directories variable.
- @_rl_complete_mark_symlink_dirs = false
-
- # If non-zero, completions are printed horizontally in alphabetical order,
- # like `ls -x'.
- @_rl_print_completions_horizontally = false
-
- @_rl_completion_case_fold = false
-
- # If non-zero, don't match hidden files (filenames beginning with a `.' on
- # Unix) when doing filename completion.
- @_rl_match_hidden_files = true
-
- # Global variables available to applications using readline.
-
- # Non-zero means add an additional character to each filename displayed
- # during listing completion iff rl_filename_completion_desired which helps
- # to indicate the type of file being listed.
- @rl_visible_stats = false
-
- # If non-zero, then this is the address of a function to call when
- # completing on a directory name. The function is called with
- # the address of a string (the current directory name) as an arg.
- @rl_directory_completion_hook = nil
-
- @rl_directory_rewrite_hook = nil
-
- # Non-zero means readline completion functions perform tilde expansion.
- @rl_complete_with_tilde_expansion = false
-
- # Pointer to the generator function for completion_matches ().
- # NULL means to use rl_filename_completion_function (), the default filename
- # completer.
- @rl_completion_entry_function = nil
-
- # Pointer to alternative function to create matches.
- # Function is called with TEXT, START, and END.
- # START and END are indices in RL_LINE_BUFFER saying what the boundaries
- # of TEXT are.
- # If this function exists and returns NULL then call the value of
- # rl_completion_entry_function to try to match, otherwise use the
- # array of strings returned.
- @rl_attempted_completion_function = nil
-
- # Non-zero means to suppress normal filename completion after the
- # user-specified completion function has been called.
- @rl_attempted_completion_over = false
-
- # Set to a character indicating the type of completion being performed
- # by rl_complete_internal, available for use by application completion
- # functions.
- @rl_completion_type = 0
-
- # Up to this many items will be displayed in response to a
- # possible-completions call. After that, we ask the user if
- # she is sure she wants to see them all. A negative value means
- # don't ask.
- @rl_completion_query_items = 100
-
- @_rl_page_completions = 1
-
- # The basic list of characters that signal a break between words for the
- # completer routine. The contents of this variable is what breaks words
- # in the shell, i.e. " \t\n\"\\'`@$><="
- @rl_basic_word_break_characters = " \t\n\"\\'`@$><=|&{(" # })
-
- # List of basic quoting characters.
- @rl_basic_quote_characters = "\"'"
-
- # The list of characters that signal a break between words for
- # rl_complete_internal. The default list is the contents of
- # rl_basic_word_break_characters.
- @rl_completer_word_break_characters = nil
-
- # Hook function to allow an application to set the completion word
- # break characters before readline breaks up the line. Allows
- # position-dependent word break characters.
- @rl_completion_word_break_hook = nil
-
- # List of characters which can be used to quote a substring of the line.
- # Completion occurs on the entire substring, and within the substring
- # rl_completer_word_break_characters are treated as any other character,
- # unless they also appear within this list.
- @rl_completer_quote_characters = nil
-
- # List of characters that should be quoted in filenames by the completer.
- @rl_filename_quote_characters = nil
-
- # List of characters that are word break characters, but should be left
- # in TEXT when it is passed to the completion function. The shell uses
- # this to help determine what kind of completing to do.
- @rl_special_prefixes = nil
-
- # If non-zero, then disallow duplicates in the matches.
- @rl_ignore_completion_duplicates = true
-
- # Non-zero means that the results of the matches are to be treated
- # as filenames. This is ALWAYS zero on entry, and can only be changed
- # within a completion entry finder function.
- @rl_filename_completion_desired = false
-
- # Non-zero means that the results of the matches are to be quoted using
- # double quotes (or an application-specific quoting mechanism) if the
- # filename contains any characters in rl_filename_quote_chars. This is
- # ALWAYS non-zero on entry, and can only be changed within a completion
- # entry finder function.
- @rl_filename_quoting_desired = true
-
- # This function, if defined, is called by the completer when real
- # filename completion is done, after all the matching names have been
- # generated. It is passed a (char**) known as matches in the code below.
- # It consists of a NULL-terminated array of pointers to potential
- # matching strings. The 1st element (matches[0]) is the maximal
- # substring that is common to all matches. This function can re-arrange
- # the list of matches as required, but all elements of the array must be
- # free()'d if they are deleted. The main intent of this function is
- # to implement FIGNORE a la SunOS csh.
- @rl_ignore_some_completions_function = nil
-
- # Set to a function to quote a filename in an application-specific fashion.
- # Called with the text to quote, the type of match found (single or multiple)
- # and a pointer to the quoting character to be used, which the function can
- # reset if desired.
- #rl_filename_quoting_function = rl_quote_filename
-
- # Function to call to remove quoting characters from a filename. Called
- # before completion is attempted, so the embedded quotes do not interfere
- # with matching names in the file system. Readline doesn't do anything
- # with this it's set only by applications.
- @rl_filename_dequoting_function = nil
-
- # Function to call to decide whether or not a word break character is
- # quoted. If a character is quoted, it does not break words for the
- # completer.
- @rl_char_is_quoted_p = nil
-
- # If non-zero, the completion functions don't append anything except a
- # possible closing quote. This is set to 0 by rl_complete_internal and
- # may be changed by an application-specific completion function.
- @rl_completion_suppress_append = false
-
- # Character appended to completed words when at the end of the line. The
- # default is a space.
- @rl_completion_append_character = ' '
-
- # If non-zero, the completion functions don't append any closing quote.
- # This is set to 0 by rl_complete_internal and may be changed by an
- # application-specific completion function.
- @rl_completion_suppress_quote = false
-
- # Set to any quote character readline thinks it finds before any application
- # completion function is called.
- @rl_completion_quote_character = 0
-
- # Set to a non-zero value if readline found quoting anywhere in the word to
- # be completed set before any application completion function is called.
- @rl_completion_found_quote = false
-
- # If non-zero, a slash will be appended to completed filenames that are
- # symbolic links to directory names, subject to the value of the
- # mark-directories variable (which is user-settable). This exists so
- # that application completion functions can override the user's preference
- # (set via the mark-symlinked-directories variable) if appropriate.
- # It's set to the value of _rl_complete_mark_symlink_dirs in
- # rl_complete_internal before any application-specific completion
- # function is called, so without that function doing anything, the user's
- # preferences are honored.
- @rl_completion_mark_symlink_dirs = false
-
- # If non-zero, inhibit completion (temporarily).
- @rl_inhibit_completion = false
-
- # Variables local to this file.
-
- # Local variable states what happened during the last completion attempt.
- @completion_changed_buffer = nil
-
- # Non-zero means treat 0200 bit in terminal input as Meta bit.
- @_rl_meta_flag = false
-
- # Stack of previous values of parsing_conditionalized_out.
- @if_stack = []
- @if_stack_depth = 0
-
-
- # The last key bindings file read.
- @last_readline_init_file = nil
-
- # The file we're currently reading key bindings from.
- @current_readline_init_file = nil
- @current_readline_init_include_level = 0
- @current_readline_init_lineno = 0
-
- ENV["HOME"] ||= ENV["HOMEDRIVE"]+ENV["HOMEPATH"]
-
- @directory = nil
- @filename = nil
- @dirname = nil
- @users_dirname = nil
- @filename_len = 0
-
- attr_accessor :rl_attempted_completion_function,:rl_deprep_term_function,
- :rl_event_hook,:rl_attempted_completion_over,:rl_basic_quote_characters,
- :rl_basic_word_break_characters,:rl_completer_quote_characters,
- :rl_completer_word_break_characters,:rl_completion_append_character,
- :rl_filename_quote_characters,:rl_instream,:rl_library_version,:rl_outstream,
- :rl_readline_name,:history_length,:history_base
-
- module_function
- # Okay, now we write the entry_function for filename completion. In the
- # general case. Note that completion in the shell is a little different
- # because of all the pathnames that must be followed when looking up the
- # completion for a command.
- def rl_filename_completion_function(text, state)
- # If we don't have any state, then do some initialization.
- if (state == 0)
- # If we were interrupted before closing the directory or reading
- #all of its contents, close it.
- if(@directory)
- @directory.close
- @directory = nil
- end
- text.delete!(0.chr)
- @filename = text.dup
- if text.length == 0
- text = "."
- end
- @dirname = File.dirname(text)
- # We aren't done yet. We also support the "~user" syntax.
-
- # Save the version of the directory that the user typed.
- @users_dirname = @dirname.dup
-
- if (@dirname[0] == ?~)
- @dirname = File.expand_path(@dirname)
- end
-
- # The directory completion hook should perform any necessary
- # dequoting.
- if (@rl_directory_completion_hook && send(rl_directory_completion_hook,@dirname))
- @users_dirname = @dirname.dup
- elsif (@rl_completion_found_quote && @rl_filename_dequoting_function)
- # delete single and double quotes
- @temp = send(@rl_filename_dequoting_function,@users_dirname, @rl_completion_quote_character)
- @users_dirname = temp
- end
-
- @directory = Dir.new(@dirname)
-
- # Now dequote a non-null filename.
- if (@filename && @filename.length>0 && @rl_completion_found_quote && @rl_filename_dequoting_function)
- # delete single and double quotes
- temp = send(@rl_filename_dequoting_function,@filename, @rl_completion_quote_character)
- @filename = temp
- end
-
- @filename_len = @filename.length
- @rl_filename_completion_desired = true
- end
-
- # At this point we should entertain the possibility of hacking wildcarded
- # filenames, like /usr/man/man<WILD>/te<TAB>. If the directory name
- # contains globbing characters, then build an array of directories, and
- # then map over that list while completing.
- # *** UNIMPLEMENTED ***
-
- # Now that we have some state, we can read the directory.
- entry = nil
- while(@directory && (entry = @directory.read))
- d_name = entry
- # Special case for no filename. If the user has disabled the
- # `match-hidden-files' variable, skip filenames beginning with `.'.
- #All other entries except "." and ".." match.
- if (@filename_len == 0)
- if (!@_rl_match_hidden_files && d_name[0]==?.)
- next
- end
- if (d_name != '.' && d_name != '..')
- break
- end
- else
- # Otherwise, if these match up to the length of filename, then
- # it is a match.
-
- if (@_rl_completion_case_fold)
- break if d_name =~ /^#{Regexp.escape(@filename)}/i
- else
- break if d_name =~ /^#{Regexp.escape(@filename)}/
- end
- end
- end
-
- if entry.nil?
- if @directory
- @directory.close
- @directory = nil
- end
- @dirname = nil
- @filename = nil
- @users_dirname = nil
-
- return nil
- else
- if (@dirname != '.')
- if (@rl_complete_with_tilde_expansion && @users_dirname[0] == ?~)
- temp = @dirname
- if(temp[-1] != ?/)
- temp += '/'
- end
- else
- temp = @users_dirname
- if(temp[-1] != ?/)
- temp += '/'
- end
- end
- temp += entry
- else
- temp = entry.dup
- end
- return (temp)
- end
- end
-
- # A completion function for usernames.
- # TEXT contains a partial username preceded by a random
- # character (usually `~').
- def rl_username_completion_function(text, state)
- return nil if RUBY_PLATFORM =~ /mswin|mingw/
-
- if (state == 0)
- first_char = text[0]
- first_char_loc = (text[0] == ?~ ? 1 : 0)
-
- username = text[first_char_loc..-1]
- namelen = username.length
- Etc.setpwent()
- end
-
- while (entry = Etc.getpwent())
- # Null usernames should result in all users as possible completions.
- break if (namelen == 0 || entry.name =~ /^#{username}/ )
- end
-
- if entry.nil?
- Etc.endpwent()
- return nil
- else
- value = text.dup
- value[first_char_loc..-1] = entry.name
-
- if (first_char == ?~)
- @rl_filename_completion_desired = true
- end
-
- return (value)
- end
- end
-
- #*************************************************************
- #
- # Application-callable completion match generator functions
- #
- #*************************************************************
-
- # Return an array of (char *) which is a list of completions for TEXT.
- # If there are no completions, return a NULL pointer.
- # The first entry in the returned array is the substitution for TEXT.
- # The remaining entries are the possible completions.
- # The array is terminated with a NULL pointer.
- #
- # ENTRY_FUNCTION is a function of two args, and returns a (char *).
- # The first argument is TEXT.
- # The second is a state argument it should be zero on the first call, and
- # non-zero on subsequent calls. It returns a NULL pointer to the caller
- # when there are no more matches.
- #
- def rl_completion_matches(text, entry_function)
- matches = 0
- match_list_size = 10
- match_list = []
- match_list[1] = nil
- while (string = send(entry_function, text, matches))
- match_list[matches+=1] = string
- match_list[matches+1] = nil
- end
-
- # If there were any matches, then look through them finding out the
- # lowest common denominator. That then becomes match_list[0].
- if (matches!=0)
- compute_lcd_of_matches(match_list, matches, text)
- else # There were no matches.
- match_list = nil
- end
- return (match_list)
- end
-
- def _rl_to_lower(char)
- char.nil? ? nil : char.chr.downcase
- end
-
- # Find the common prefix of the list of matches, and put it into
- # matches[0].
- def compute_lcd_of_matches(match_list, matches, text)
- # If only one match, just use that. Otherwise, compare each
- # member of the list with the next, finding out where they
- # stop matching.
- if (matches == 1)
- match_list[0] = match_list[1]
- match_list[1] = nil
- return 1
- end
-
- i = 1
- low = 100000
- while(i<matches)
- if (@_rl_completion_case_fold)
- si = 0
- while((c1 = _rl_to_lower(match_list[i][si])) &&
- (c2 = _rl_to_lower(match_list[i + 1][si])))
- if !@rl_byte_oriented
- if(!_rl_compare_chars(match_list[i],si,match_list[i+1],si))
- break
- elsif ((v = _rl_get_char_len(match_list[i][si..-1])) > 1)
- si += v - 1
- end
- else
- break if (c1 != c2)
- end
- si += 1
- end
- else
- si = 0
- while((c1 = match_list[i][si]) &&
- (c2 = match_list[i + 1][si]))
- if !@rl_byte_oriented
- if(!_rl_compare_chars(match_list[i],si,match_list[i+1],si))
- break
- elsif ((v = _rl_get_char_len(match_list[i][si..-1])) > 1)
- si += v - 1
- end
- else
- break if (c1 != c2)
- end
- si += 1
- end
- end
-
- if (low > si)
- low = si
- end
- i += 1
- end
-
- # If there were multiple matches, but none matched up to even the
- # first character, and the user typed something, use that as the
- # value of matches[0].
- if (low == 0 && text && text.length>0 )
- match_list[0] = text.dup
- else
- # XXX - this might need changes in the presence of multibyte chars
-
- # If we are ignoring case, try to preserve the case of the string
- # the user typed in the face of multiple matches differing in case.
- if (@_rl_completion_case_fold)
-
- # We're making an assumption here:
- # IF we're completing filenames AND
- # the application has defined a filename dequoting function AND
- # we found a quote character AND
- # the application has requested filename quoting
- # THEN
- # we assume that TEXT was dequoted before checking against
- # the file system and needs to be dequoted here before we
- # check against the list of matches
- # FI
- if (@rl_filename_completion_desired &&
- @rl_filename_dequoting_function &&
- @rl_completion_found_quote &&
- @rl_filename_quoting_desired)
-
- dtext = send(@rl_filename_dequoting_function,text, @rl_completion_quote_character)
- text = dtext
- end
-
- # sort the list to get consistent answers.
- match_list = [match_list[0]] + match_list[1..-1].sort
-
- si = text.length
- if (si <= low)
- for i in 1 .. matches
- if match_list[i][0,si] == text
- match_list[0] = match_list[i][0,low]
- break
- end
- # no casematch, use first entry
- if (i > matches)
- match_list[0] = match_list[1][0,low]
- end
- end
- else
- # otherwise, just use the text the user typed.
- match_list[0] = text[0,low]
- end
- else
- match_list[0] = match_list[1][0,low]
- end
- end
-
- return matches
- end
-
-
- def rl_vi_editing_mode(count, key)
- _rl_set_insert_mode(RL_IM_INSERT, 1) # vi mode ignores insert mode
- @rl_editing_mode = @vi_mode
- rl_vi_insertion_mode(1, key)
- 0
- end
-
- # Switching from one mode to the other really just involves
- # switching keymaps.
- def rl_vi_insertion_mode(count, key)
- @_rl_keymap = @vi_insertion_keymap
- @_rl_vi_last_key_before_insert = key
- 0
- end
-
- def rl_emacs_editing_mode(count, key)
- @rl_editing_mode = @emacs_mode
- _rl_set_insert_mode(RL_IM_INSERT, 1) # emacs mode default is insert mode
- @_rl_keymap = @emacs_standard_keymap
- 0
- end
-
- # Function for the rest of the library to use to set insert/overwrite mode.
- def _rl_set_insert_mode(im, force)
- @r…
Large files files are truncated, but you can click here to view the full file