comparison src/ex_cmds.c @ 9377:5ec4fbfe38c5 v7.4.1970

commit https://github.com/vim/vim/commit/70e136e1d86ea1d795774824c7b712245912946d Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jul 1 14:04:51 2016 +0200 patch 7.4.1970 Problem: Using ":insert" in an empty buffer sets the jump mark. (Ingo Karkat) Solution: Don't adjust marks when replacing the empty line in an empty buffer. (closes #892)
author Christian Brabandt <cb@256bit.org>
date Fri, 01 Jul 2016 14:15:06 +0200
parents 25c562442f8c
children f094d4085014
comparison
equal deleted inserted replaced
9376:51f8cb5e7466 9377:5ec4fbfe38c5
4370 append_indent = get_indent_lnum(lnum); 4370 append_indent = get_indent_lnum(lnum);
4371 4371
4372 if (eap->cmdidx != CMD_append) 4372 if (eap->cmdidx != CMD_append)
4373 --lnum; 4373 --lnum;
4374 4374
4375 /* when the buffer is empty append to line 0 and delete the dummy line */ 4375 /* when the buffer is empty need to delete the dummy line */
4376 if (empty && lnum == 1) 4376 if (empty && lnum == 1)
4377 lnum = 0; 4377 lnum = 0;
4378 4378
4379 State = INSERT; /* behave like in Insert mode */ 4379 State = INSERT; /* behave like in Insert mode */
4380 if (curbuf->b_p_iminsert == B_IMODE_LMAP) 4380 if (curbuf->b_p_iminsert == B_IMODE_LMAP)
4454 if (p[0] == NUL) 4454 if (p[0] == NUL)
4455 theline[0] = NUL; 4455 theline[0] = NUL;
4456 4456
4457 did_undo = TRUE; 4457 did_undo = TRUE;
4458 ml_append(lnum, theline, (colnr_T)0, FALSE); 4458 ml_append(lnum, theline, (colnr_T)0, FALSE);
4459 appended_lines_mark(lnum, 1L); 4459 appended_lines_mark(lnum + (empty ? 1 : 0), 1L);
4460 4460
4461 vim_free(theline); 4461 vim_free(theline);
4462 ++lnum; 4462 ++lnum;
4463 4463
4464 if (empty) 4464 if (empty)