diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2024-05-20 21:17:21 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-20 21:17:21 +0800 |
| commit | 36a9da65472f1607568c9be9b91c06357e39fce4 (patch) | |
| tree | 225a99d08431a6f295c01e60f17ccbe65075a57a /src/nvim/ops.c | |
| parent | 5c2616846aa4d85ba96adefea98ed50f46f7a291 (diff) | |
| parent | e0259b9466a0dd62b74d4aa195b3c5e6c7a183d0 (diff) | |
| download | rneovim-36a9da65472f1607568c9be9b91c06357e39fce4.tar.gz rneovim-36a9da65472f1607568c9be9b91c06357e39fce4.tar.bz2 rneovim-36a9da65472f1607568c9be9b91c06357e39fce4.zip | |
Merge pull request #28854 from zeertzjq/vim-9.1.0394
vim-patch:9.1.{0394,0395,0423}: getregionpos()
Diffstat (limited to 'src/nvim/ops.c')
| -rw-r--r-- | src/nvim/ops.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c index d54eea0f3e..707cf5ca9a 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -4258,6 +4258,7 @@ void charwise_block_prep(pos_T start, pos_T end, struct block_def *bdp, linenr_T char *p = ml_get(lnum); bdp->startspaces = 0; bdp->endspaces = 0; + bdp->start_char_vcols = 0; if (lnum == start.lnum) { startcol = start.col; @@ -4265,7 +4266,8 @@ void charwise_block_prep(pos_T start, pos_T end, struct block_def *bdp, linenr_T getvcol(curwin, &start, &cs, NULL, &ce); if (ce != cs && start.coladd > 0) { // Part of a tab selected -- but don't double-count it. - bdp->startspaces = (ce - cs + 1) - start.coladd; + bdp->start_char_vcols = ce - cs + 1; + bdp->startspaces = bdp->start_char_vcols - start.coladd; if (bdp->startspaces < 0) { bdp->startspaces = 0; } @@ -4303,6 +4305,7 @@ void charwise_block_prep(pos_T start, pos_T end, struct block_def *bdp, linenr_T } else { bdp->textlen = endcol - startcol + inclusive; } + bdp->textcol = startcol; bdp->textstart = p + startcol; } |