Patch 8.2.2166

5 views
Skip to first unread message

Bram Moolenaar

unread,
Dec 20, 2020, 7:08:26 AM12/20/20
to vim...@googlegroups.com

Patch 8.2.2166
Problem: Auto format doesn't work when deleting text.
Solution: Make "x" trigger auto format. (closes #7504)
Files: src/ops.c, src/testdir/test_textformat.vim


*** ../vim-8.2.2165/src/ops.c 2020-11-21 14:16:18.536766447 +0100
--- src/ops.c 2020-12-20 13:01:54.754992944 +0100
***************
*** 938,943 ****
--- 938,944 ----
curwin->w_cursor = curpos; // restore curwin->w_cursor
(void)do_join(2, FALSE, FALSE, FALSE, FALSE);
}
+ auto_format(FALSE, TRUE);
}

msgmore(curbuf->b_ml.ml_line_count - old_lcount);
*** ../vim-8.2.2165/src/testdir/test_textformat.vim 2020-06-24 13:37:03.162425194 +0200
--- src/testdir/test_textformat.vim 2020-12-20 12:53:34.348529819 +0100
***************
*** 934,939 ****
--- 934,951 ----
call assert_equal('g uu uu ', getline(1)[-8:])
call assert_equal(['uu. foo'], getline(2, '$'))

+ " using backspace or "x" triggers reformat
+ call setline(1, ['1 2 3 4 5 ', '6 7 8 9'])
+ set tw=10
+ set fo=taw
+ set bs=indent,eol,start
+ exe "normal 1G4la\<BS>\<BS>\<Esc>"
+ call assert_equal(['1 2 4 5 6 ', '7 8 9'], getline(1, 2))
+ exe "normal f4xx"
+ call assert_equal(['1 2 5 6 7 ', '8 9'], getline(1, 2))
+
+ set tw=0
+ set fo&
%bw!
endfunc

*** ../vim-8.2.2165/src/version.c 2020-12-19 22:10:09.861835442 +0100
--- src/version.c 2020-12-20 13:02:11.910940256 +0100
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2166,
/**/

--
Team-building exercises come in many forms but they all trace their roots back
to the prison system. In your typical team-building exercise the employees
are subjected to a variety of unpleasant situations until they become either a
cohesive team or a ring of car jackers.
(Scott Adams - The Dilbert principle)

/// Bram Moolenaar -- Br...@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 ///
Reply all
Reply to author
Forward
0 new messages