aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/normal.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-09-24 20:01:58 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-10-01 22:27:43 -0400
commit24c4d4e1258f8ca34eb581550776ef613c27a689 (patch)
treed1a340b9ea63f7db6ffb4da92faf794a5ea2115f /src/nvim/normal.c
parent0253f0cd929a59e1516359eab9ae84ce39643a7b (diff)
downloadrneovim-24c4d4e1258f8ca34eb581550776ef613c27a689.tar.gz
rneovim-24c4d4e1258f8ca34eb581550776ef613c27a689.tar.bz2
rneovim-24c4d4e1258f8ca34eb581550776ef613c27a689.zip
vim-patch:8.1.2072: "gk" moves to start of line instead of upwards
Problem: "gk" moves to start of line instead of upwards. Solution: Fix off-by-one error. (Christian Brabandt, closes vim/vim#4969) https://github.com/vim/vim/commit/03ac52fc025790c474030ea556cec799400aa046
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r--src/nvim/normal.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index 4dfde96e94..d4065cc06e 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -3932,11 +3932,11 @@ static bool nv_screengo(oparg_T *oap, int dir, long dist)
while (dist--) {
if (dir == BACKWARD) {
- if ((long)curwin->w_curswant >= width2)
- /* move back within line */
+ if (curwin->w_curswant > width2) {
+ // move back within line
curwin->w_curswant -= width2;
- else {
- /* to previous line */
+ } else {
+ // to previous line
if (curwin->w_cursor.lnum == 1) {
retval = false;
break;