diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-07-27 18:44:57 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-07-27 18:44:57 +0200 |
commit | d5c8234517c18fa059b78f59eb96c35eda323dae (patch) | |
tree | abd953fac030f67c31a0b4b9cfcc01db6156a89a /src/normal.c | |
parent | 298466629119eda501cfdf7824797f05045e67ca (diff) | |
download | vim-git-d5c8234517c18fa059b78f59eb96c35eda323dae.tar.gz |
patch 8.1.1758: count of g$ not used correctly when text is not wrappedv8.1.1758
Problem: Count of g$ not used correctly when text is not wrapped.
Solution: Do use the count. (Christian Brabandt, closes #4729, closes #4566)
Diffstat (limited to 'src/normal.c')
-rw-r--r-- | src/normal.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/normal.c b/src/normal.c index ce1acb555..acc5b64ab 100644 --- a/src/normal.c +++ b/src/normal.c @@ -8062,10 +8062,14 @@ nv_g_cmd(cmdarg_T *cap) } else { + if (cap->count1 > 1) + // if it fails, let the cursor still move to the last char + cursor_down(cap->count1 - 1, FALSE); + i = curwin->w_leftcol + curwin->w_width - col_off - 1; coladvance((colnr_T)i); - /* Make sure we stick in this column. */ + // Make sure we stick in this column. validate_virtcol(); curwin->w_curswant = curwin->w_virtcol; curwin->w_set_curswant = FALSE; |