| To: vim_dev@googlegroups.com |
| Subject: Patch 7.4.634 |
| Fcc: outbox |
| From: Bram Moolenaar <Bram@moolenaar.net> |
| Mime-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| |
| Patch 7.4.634 |
| Problem: Marks are not restored after redo + undo. |
| Solution: Fix the way marks are restored. (Olaf Dabrunz) |
| Files: src/undo.c, src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, |
| src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, |
| src/testdir/Make_vms.mms, src/testdir/Makefile, |
| src/testdir/test_marks.in, src/testdir/test_marks.ok |
| |
| |
| |
| |
| |
| *** 2847,2857 **** |
| * restore marks from before undo/redo |
| */ |
| for (i = 0; i < NMARKS; ++i) |
| if (curhead->uh_namedm[i].lnum != 0) |
| - { |
| curbuf->b_namedm[i] = curhead->uh_namedm[i]; |
| curhead->uh_namedm[i] = namedm[i]; |
| ! } |
| if (curhead->uh_visual.vi_start.lnum != 0) |
| { |
| curbuf->b_visual = curhead->uh_visual; |
| --- 2847,2860 ---- |
| * restore marks from before undo/redo |
| */ |
| for (i = 0; i < NMARKS; ++i) |
| + { |
| if (curhead->uh_namedm[i].lnum != 0) |
| curbuf->b_namedm[i] = curhead->uh_namedm[i]; |
| + if (namedm[i].lnum != 0) |
| curhead->uh_namedm[i] = namedm[i]; |
| ! else |
| ! curhead->uh_namedm[i].lnum = 0; |
| ! } |
| if (curhead->uh_visual.vi_start.lnum != 0) |
| { |
| curbuf->b_visual = curhead->uh_visual; |
| |
| |
| |
| *** 48,53 **** |
| --- 48,54 ---- |
| test_listlbr.out \ |
| test_listlbr_utf8.out \ |
| test_mapping.out \ |
| + test_marks.out \ |
| test_nested_function.out \ |
| test_options.out \ |
| test_qf_title.out \ |
| |
| *** 188,193 **** |
| --- 189,195 ---- |
| test_listlbr.out: test_listlbr.in |
| test_listlbr_utf8.out: test_listlbr_utf8.in |
| test_mapping.out: test_mapping.in |
| + test_marks.out: test_marks.in |
| test_nested_function.out: test_nested_function.in |
| test_options.out: test_options.in |
| test_qf_title.out: test_qf_title.in |
| |
| |
| |
| *** 47,52 **** |
| --- 47,53 ---- |
| test_listlbr.out \ |
| test_listlbr_utf8.out \ |
| test_mapping.out \ |
| + test_marks.out \ |
| test_nested_function.out \ |
| test_options.out \ |
| test_qf_title.out \ |
| |
| |
| |
| *** 69,74 **** |
| --- 69,75 ---- |
| test_listlbr.out \ |
| test_listlbr_utf8.out \ |
| test_mapping.out \ |
| + test_marks.out \ |
| test_nested_function.out \ |
| test_options.out \ |
| test_qf_title.out \ |
| |
| |
| |
| *** 49,54 **** |
| --- 49,55 ---- |
| test_listlbr.out \ |
| test_listlbr_utf8.out \ |
| test_mapping.out \ |
| + test_marks.out \ |
| test_nested_function.out \ |
| test_options.out \ |
| test_qf_title.out \ |
| |
| |
| |
| *** 108,113 **** |
| --- 108,114 ---- |
| test_listlbr.out \ |
| test_listlbr_utf8.out \ |
| test_mapping.out \ |
| + test_marks.out \ |
| test_nested_function.out \ |
| test_options.out \ |
| test_qf_title.out \ |
| |
| |
| |
| *** 45,50 **** |
| --- 45,51 ---- |
| test_listlbr.out \ |
| test_listlbr_utf8.out \ |
| test_mapping.out \ |
| + test_marks.out \ |
| test_nested_function.out \ |
| test_options.out \ |
| test_qf_title.out \ |
| |
| |
| |
| |
| --- 1,18 ---- |
| + Tests for marks. |
| + |
| + STARTTEST |
| + :so small.vim |
| + :" test that a deleted mark is restored after delete-undo-redo-undo |
| + :/^\t/+1 |
| + :set nocp viminfo+=nviminfo |
| + madduu |
| + :let a = string(getpos("'a")) |
| + :$put ='Mark after delete-undo-redo-undo: '.a |
| + :/^\t/,$wq! test.out |
| + ENDTEST |
| + |
| + textline A |
| + textline B |
| + textline C |
| + |
| + Results: |
| |
| |
| |
| |
| --- 1,6 ---- |
| + textline A |
| + textline B |
| + textline C |
| + |
| + Results: |
| + Mark after delete-undo-redo-undo: [0, 15, 2, 0] |
| |
| |
| |
| *** 743,744 **** |
| --- 743,746 ---- |
| { /* Add new patch number below this line */ |
| + /**/ |
| + 634, |
| /**/ |
| |
| -- |
| "Women marry men hoping they will change. Men marry women hoping |
| they will not. So each is inevitably disappointed." |
| - Einstein |
| |
| /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ |
| /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ |
| \\\ an exciting new programming language -- http://www.Zimbu.org /// |
| \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |