guillermooo / Vintageous

Vi/Vim emulation for Sublime Text 3
http://guillermooo.bitbucket.org/Vintageous/
Other
1.64k stars 115 forks source link

Correct range computation for backward movement #1027

Closed deconvolved closed 8 years ago

deconvolved commented 8 years ago

The range computed for backward movement in _vi_go_to_line for INTERNAL_NORMAL mode does not properly account for the case of backward movement (e.g. when using the sequence d1G). Currently the resulting range extends from the end of the first line to the beginning of the last line, when it should be from the beginning of the first to the end of the last.

Distinguish between the three cases of the start line being the same as the destination line, the start line coming before the destination line, and the destination line coming before the start line, and set the range boundaries accordingly.

guillermooo commented 8 years ago

LGTM