Mercurial > vim
comparison src/normal.c @ 12164:5d82470552ce v8.0.0962
patch 8.0.0962: crash with virtualedit and joining lines
commit https://github.com/vim/vim/commit/9aa156912867c05e0a6480925afe11c590378f09
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Aug 19 15:05:32 2017 +0200
patch 8.0.0962: crash with virtualedit and joining lines
Problem: Crash with virtualedit and joining lines. (Joshua T Corbin, Neovim
https://github.com/vim/vim/issues/6726)
Solution: When using a mark check that coladd is valid.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 19 Aug 2017 15:15:03 +0200 |
parents | 60cf03e59402 |
children | 55cf556d8ce1 |
comparison
equal
deleted
inserted
replaced
12163:ffe3a2b3fa78 | 12164:5d82470552ce |
---|---|
1569 unadjust_for_sel(); | 1569 unadjust_for_sel(); |
1570 } | 1570 } |
1571 | 1571 |
1572 oap->start = VIsual; | 1572 oap->start = VIsual; |
1573 if (VIsual_mode == 'V') | 1573 if (VIsual_mode == 'V') |
1574 { | |
1574 oap->start.col = 0; | 1575 oap->start.col = 0; |
1576 # ifdef FEAT_VIRTUALEDIT | |
1577 oap->start.coladd = 0; | |
1578 # endif | |
1579 } | |
1575 } | 1580 } |
1576 | 1581 |
1577 /* | 1582 /* |
1578 * Set oap->start to the first position of the operated text, oap->end | 1583 * Set oap->start to the first position of the operated text, oap->end |
1579 * to the end of the operated text. w_cursor is equal to oap->start. | 1584 * to the end of the operated text. w_cursor is equal to oap->start. |
7578 #ifdef FEAT_VIRTUALEDIT | 7583 #ifdef FEAT_VIRTUALEDIT |
7579 /* May need to clear the coladd that a mark includes. */ | 7584 /* May need to clear the coladd that a mark includes. */ |
7580 if (!virtual_active()) | 7585 if (!virtual_active()) |
7581 curwin->w_cursor.coladd = 0; | 7586 curwin->w_cursor.coladd = 0; |
7582 #endif | 7587 #endif |
7588 check_cursor_col(); | |
7583 #ifdef FEAT_FOLDING | 7589 #ifdef FEAT_FOLDING |
7584 if (cap->oap->op_type == OP_NOP | 7590 if (cap->oap->op_type == OP_NOP |
7585 && pos != NULL | 7591 && pos != NULL |
7586 && (pos == (pos_T *)-1 || !EQUAL_POS(old_cursor, *pos)) | 7592 && (pos == (pos_T *)-1 || !EQUAL_POS(old_cursor, *pos)) |
7587 && (fdo_flags & FDO_MARK) | 7593 && (fdo_flags & FDO_MARK) |