Mercurial > vim
comparison src/normal.c @ 31881:df061831a85f v9.0.1273
patch 9.0.1273: "1v" may select block with wrong size
Commit: https://github.com/vim/vim/commit/8f531662e28c37560bf5ac20a059bf00d01ee5a4
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Feb 1 17:33:18 2023 +0000
patch 9.0.1273: "1v" may select block with wrong size
Problem: "1v" may select block with wrong size. (Evgeni Chasnovski)
Solution: Compute "curswant" in the right line. (closes https://github.com/vim/vim/issues/11925)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 01 Feb 2023 18:45:04 +0100 |
parents | 3365a601e73b |
children | d8fdafc4b390 |
comparison
equal
deleted
inserted
replaced
31880:2902f885b9dc | 31881:df061831a85f |
---|---|
5491 curwin->w_curswant = MAXCOL; | 5491 curwin->w_curswant = MAXCOL; |
5492 coladvance((colnr_T)MAXCOL); | 5492 coladvance((colnr_T)MAXCOL); |
5493 } | 5493 } |
5494 else if (VIsual_mode == Ctrl_V) | 5494 else if (VIsual_mode == Ctrl_V) |
5495 { | 5495 { |
5496 // Update curswant on the original line, that is where "col" is | |
5497 // valid. | |
5498 linenr_T lnum = curwin->w_cursor.lnum; | |
5499 curwin->w_cursor.lnum = VIsual.lnum; | |
5496 update_curswant_force(); | 5500 update_curswant_force(); |
5497 curwin->w_curswant += + resel_VIsual_vcol * cap->count0 - 1; | 5501 curwin->w_curswant += resel_VIsual_vcol * cap->count0 - 1; |
5502 curwin->w_cursor.lnum = lnum; | |
5498 coladvance(curwin->w_curswant); | 5503 coladvance(curwin->w_curswant); |
5499 } | 5504 } |
5500 else | 5505 else |
5501 curwin->w_set_curswant = TRUE; | 5506 curwin->w_set_curswant = TRUE; |
5502 redraw_curbuf_later(UPD_INVERTED); // show the inversion | 5507 redraw_curbuf_later(UPD_INVERTED); // show the inversion |