Mercurial > vim
comparison src/fold.c @ 22009:24cef4317d92 v8.2.1554
patch 8.2.1554: crash in normal test
Commit: https://github.com/vim/vim/commit/07e87e9eb5e7195d47d47c0ca752b6c8372a99ea
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Aug 31 21:22:40 2020 +0200
patch 8.2.1554: crash in normal test
Problem: Crash in normal test.
Solution: Skip adjusting marks if there are no folds.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 31 Aug 2020 21:30:04 +0200 |
parents | 3ea6b4a5369a |
children | 514d622473af |
comparison
equal
deleted
inserted
replaced
22008:3ea6b4a5369a | 22009:24cef4317d92 |
---|---|
1512 { | 1512 { |
1513 fold_T *fp; | 1513 fold_T *fp; |
1514 int i; | 1514 int i; |
1515 linenr_T last; | 1515 linenr_T last; |
1516 linenr_T top; | 1516 linenr_T top; |
1517 | |
1518 if (gap->ga_len == 0) | |
1519 return; | |
1517 | 1520 |
1518 // In Insert mode an inserted line at the top of a fold is considered part | 1521 // In Insert mode an inserted line at the top of a fold is considered part |
1519 // of the fold, otherwise it isn't. | 1522 // of the fold, otherwise it isn't. |
1520 if ((State & INSERT) && amount == (linenr_T)1 && line2 == MAXLNUM) | 1523 if ((State & INSERT) && amount == (linenr_T)1 && line2 == MAXLNUM) |
1521 top = line1 + 1; | 1524 top = line1 + 1; |