mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 21:14:23 +02:00
[ruby/reline] Doesn't contain terminate spaces by cw
This closes ruby/reline#233.
4c3f2e2eae
This commit is contained in:
parent
78421319d0
commit
9a7647d9eb
3 changed files with 31 additions and 9 deletions
|
@ -458,7 +458,7 @@ class Reline::Unicode
|
|||
[byte_size, width]
|
||||
end
|
||||
|
||||
def self.vi_forward_word(line, byte_pointer)
|
||||
def self.vi_forward_word(line, byte_pointer, drop_terminate_spaces = false)
|
||||
if line.bytesize > byte_pointer
|
||||
size = get_next_mbchar_size(line, byte_pointer)
|
||||
mbchar = line.byteslice(byte_pointer, size)
|
||||
|
@ -488,6 +488,7 @@ class Reline::Unicode
|
|||
width += get_mbchar_width(mbchar)
|
||||
byte_size += size
|
||||
end
|
||||
return [byte_size, width] if drop_terminate_spaces
|
||||
while line.bytesize > (byte_pointer + byte_size)
|
||||
size = get_next_mbchar_size(line, byte_pointer + byte_size)
|
||||
mbchar = line.byteslice(byte_pointer + byte_size, size)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue