diff options
author | aycabta <[email protected]> | 2020-12-24 21:24:35 +0900 |
---|---|---|
committer | aycabta <[email protected]> | 2020-12-24 23:26:22 +0900 |
commit | 0db9842b2ca85709424d6c9c1e11caeae30dfae7 (patch) | |
tree | 0270bc545fe40b88188d0a298418379e5c10a3f9 /lib/reline/unicode.rb | |
parent | 8d5d139afaf37665d2e77eeb1197e216491d805d (diff) |
[ruby/reline] Delete the last char of a line by dw
This closes ruby/reline#229.
https://github.com/ruby/reline/commit/3f0ae689c4
Diffstat (limited to 'lib/reline/unicode.rb')
-rw-r--r-- | lib/reline/unicode.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/reline/unicode.rb b/lib/reline/unicode.rb index 09aff698b8..b7cecfeaee 100644 --- a/lib/reline/unicode.rb +++ b/lib/reline/unicode.rb @@ -459,7 +459,7 @@ class Reline::Unicode end def self.vi_forward_word(line, byte_pointer) - if (line.bytesize - 1) > byte_pointer + if line.bytesize > byte_pointer size = get_next_mbchar_size(line, byte_pointer) mbchar = line.byteslice(byte_pointer, size) if mbchar =~ /\w/ @@ -474,7 +474,7 @@ class Reline::Unicode else return [0, 0] end - while (line.bytesize - 1) > (byte_pointer + byte_size) + 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) case started_by @@ -488,7 +488,7 @@ class Reline::Unicode width += get_mbchar_width(mbchar) byte_size += size end - while (line.bytesize - 1) > (byte_pointer + byte_size) + 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) break if mbchar =~ /\S/ |