File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -2029,9 +2029,16 @@ def finish
2029
2029
last_byte_size = Reline ::Unicode . get_prev_mbchar_size ( @line , @byte_pointer )
2030
2030
@byte_pointer += bytesize
2031
2031
last_mbchar = @line . byteslice ( ( @byte_pointer - bytesize - last_byte_size ) , last_byte_size )
2032
- if last_byte_size != 0 and ( last_mbchar + str ) . grapheme_clusters . size == 1
2032
+ combined_char = last_mbchar + str
2033
+ if last_byte_size != 0 and combined_char . grapheme_clusters . size == 1
2033
2034
# combined char
2034
- width = 0
2035
+ last_mbchar_width = Reline ::Unicode . get_mbchar_width ( last_mbchar )
2036
+ combined_char_width = Reline ::Unicode . get_mbchar_width ( combined_char )
2037
+ if combined_char_width > last_mbchar_width
2038
+ width = combined_char_width - last_mbchar_width
2039
+ else
2040
+ width = 0
2041
+ end
2035
2042
end
2036
2043
@cursor += width
2037
2044
@cursor_max += width
You can’t perform that action at this time.
0 commit comments