class Reline::LineEditor
def ed_insert(key)
million.
digit or if the existing argument is already greater than a
+ed-insert+. It is an error if the input character is not a
the input digit to the argument being read. Otherwise, call
Editline:: +ed-digit+ (emacs: 0 to 9) If in argument input mode, append
Failure to enlarge the edit buffer also results in an error.
error if the input character is the NUL character (+Ctrl-@+).
position. Accept an argument to do this repeatedly. It is an
cursor and move the cursor to the right by one character
position. In replace mode, overwrite the character at the
In insert mode, insert the input character left of the cursor
Editline:: +ed-insert+ (vi input: almost all; emacs: printable characters)
def ed_insert(key) nil = nil ze = nil .instance_of?(String) n y.encode(Encoding::UTF_8) ue Encoding::UndefinedConversionError turn = key size = key.bytesize n y.chr.encode(Encoding::UTF_8) ue Encoding::UndefinedConversionError turn = key.chr size = 1 _pasting tinuous_insertion_buffer << str rn not @continuous_insertion_buffer.empty? ess_insert = Reline::Unicode.get_mbchar_width(str) rsor == @cursor_max e += str e = byteinsert(@line, @byte_pointer, str) yte_size = Reline::Unicode.get_prev_mbchar_size(@line, @byte_pointer) pointer += bytesize bchar = @line.byteslice((@byte_pointer - bytesize - last_byte_size), last_byte_size) ed_char = last_mbchar + str t_byte_size != 0 and combined_char.grapheme_clusters.size == 1 mbined char _mbchar_width = Reline::Unicode.get_mbchar_width(last_mbchar) ined_char_width = Reline::Unicode.get_mbchar_width(combined_char) ombined_char_width > last_mbchar_width dth = combined_char_width - last_mbchar_width dth = 0 r += width r_max += width