Mercurial > vim
comparison src/undo.c @ 2165:733f0dc510c3
Undo changes that are meant for the Vim 7.3 branch.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sat, 15 May 2010 21:13:04 +0200 |
parents | 32f25c7ae94b |
children | f838615313cd |
comparison
equal
deleted
inserted
replaced
2163:00d8ddf20102 | 2165:733f0dc510c3 |
---|---|
240 | 240 |
241 return (u_savecommon(top, bot, (linenr_T)0)); | 241 return (u_savecommon(top, bot, (linenr_T)0)); |
242 } | 242 } |
243 | 243 |
244 /* | 244 /* |
245 * Save the line "lnum" (used by ":s" and "~" command). | 245 * save the line "lnum" (used by ":s" and "~" command) |
246 * The line is replaced, so the new bottom line is lnum + 1. | 246 * The line is replaced, so the new bottom line is lnum + 1. |
247 */ | 247 */ |
248 int | 248 int |
249 u_savesub(lnum) | 249 u_savesub(lnum) |
250 linenr_T lnum; | 250 linenr_T lnum; |
254 | 254 |
255 return (u_savecommon(lnum - 1, lnum + 1, lnum + 1)); | 255 return (u_savecommon(lnum - 1, lnum + 1, lnum + 1)); |
256 } | 256 } |
257 | 257 |
258 /* | 258 /* |
259 * A new line is inserted before line "lnum" (used by :s command). | 259 * a new line is inserted before line "lnum" (used by :s command) |
260 * The line is inserted, so the new bottom line is lnum + 1. | 260 * The line is inserted, so the new bottom line is lnum + 1. |
261 */ | 261 */ |
262 int | 262 int |
263 u_inssub(lnum) | 263 u_inssub(lnum) |
264 linenr_T lnum; | 264 linenr_T lnum; |
268 | 268 |
269 return (u_savecommon(lnum - 1, lnum, lnum + 1)); | 269 return (u_savecommon(lnum - 1, lnum, lnum + 1)); |
270 } | 270 } |
271 | 271 |
272 /* | 272 /* |
273 * Save the lines "lnum" - "lnum" + nlines (used by delete command). | 273 * save the lines "lnum" - "lnum" + nlines (used by delete command) |
274 * The lines are deleted, so the new bottom line is lnum, unless the buffer | 274 * The lines are deleted, so the new bottom line is lnum, unless the buffer |
275 * becomes empty. | 275 * becomes empty. |
276 */ | 276 */ |
277 int | 277 int |
278 u_savedel(lnum, nlines) | 278 u_savedel(lnum, nlines) |
1404 } | 1404 } |
1405 | 1405 |
1406 /* | 1406 /* |
1407 * ":undolist": List the leafs of the undo tree | 1407 * ":undolist": List the leafs of the undo tree |
1408 */ | 1408 */ |
1409 /*ARGSUSED*/ | |
1409 void | 1410 void |
1410 ex_undolist(eap) | 1411 ex_undolist(eap) |
1411 exarg_T *eap UNUSED; | 1412 exarg_T *eap; |
1412 { | 1413 { |
1413 garray_T ga; | 1414 garray_T ga; |
1414 u_header_T *uhp; | 1415 u_header_T *uhp; |
1415 int mark; | 1416 int mark; |
1416 int nomark; | 1417 int nomark; |
1526 } | 1527 } |
1527 | 1528 |
1528 /* | 1529 /* |
1529 * ":undojoin": continue adding to the last entry list | 1530 * ":undojoin": continue adding to the last entry list |
1530 */ | 1531 */ |
1532 /*ARGSUSED*/ | |
1531 void | 1533 void |
1532 ex_undojoin(eap) | 1534 ex_undojoin(eap) |
1533 exarg_T *eap UNUSED; | 1535 exarg_T *eap; |
1534 { | 1536 { |
1535 if (curbuf->b_u_newhead == NULL) | 1537 if (curbuf->b_u_newhead == NULL) |
1536 return; /* nothing changed before */ | 1538 return; /* nothing changed before */ |
1537 if (curbuf->b_u_curhead != NULL) | 1539 if (curbuf->b_u_curhead != NULL) |
1538 { | 1540 { |