Problem:
The cursor position is not updated after deleting a fold based on
markers. This results in an invalid memory reference in some scenarios.
How to reproduce:
In normal mode perform zRgg$zdaa while editing a file with the following
contents:
[[[
blah blah blah
]]]
vim: fdm=marker fmr=[[[,]]]
Fix:
The attached patch seems to fix the problem.
--
Cheers,
Lech
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---
*** src/.svn/text-base/fold.c.svn-base 2008-12-01 00:34:32.000000000 +0100
--- src/fold.c 2008-12-18 00:41:52.000000000 +0100
***************
*** 748,753 ****
--- 748,754 ----
int did_one = FALSE;
linenr_T first_lnum = MAXLNUM;
linenr_T last_lnum = 0;
+ colnr_T len;
checkupdate(curwin);
***************
*** 802,807 ****
--- 803,814 ----
changed_window_setting();
}
}
+ len = (colnr_T)STRLEN(ml_get_curline());
+ if(curwin->w_cursor.col >= len)
+ {
+ curwin->w_cursor.col = (colnr_T)(len? len - 1: 0);
+ changed_cline_bef_curs();
+ }
if (!did_one)
{
EMSG(_(e_nofold));