• R/O
  • SSH

vim: Commit

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

Revision995925603ea055ca5f1eedd2d09d12597856eb03 (tree)
Time2019-09-16 02:45:03
AuthorBram Moolenaar <Bram@vim....>
CommiterBram Moolenaar

Log Message

patch 8.1.2041: no test for diff mode with syntax highlighting

Commit: https://github.com/vim/vim/commit/248fdb33320641804afed4bdf5dc5cddb1cf64f5
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Sep 15 19:31:28 2019 +0200

patch 8.1.2041: no test for diff mode with syntax highlighting
Problem: No test for diff mode with syntax highlighting.
Solution: Add a test case.

Change Summary

Incremental Difference

diff -r c1ae47339f5c -r 995925603ea0 src/testdir/dumps/Test_diff_syntax_1.dump
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/testdir/dumps/Test_diff_syntax_1.dump Sun Sep 15 19:45:03 2019 +0200
@@ -0,0 +1,20 @@
1+| +0#0000e05#a8a8a8255@1>v+0#00e0003#ffd7ff255|o|i|d| +0#0000000&|d|o|S+2&#ff404010|o|m|e|t+0&#ffd7ff255|h|i|n|g|(|)| |{| @52
2+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@10|i+0#00e0003&|n|t| +0#0000000&|x| |=| |0+0#e000002&|;+0#0000000&| @51
3+| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@10|c+0#00e0003&|h|a|r| +0#0000000&|*|s| |=| |"+0#e000002&|t+2&#ff404010|h|e|r|e|"+0&#ffd7ff255|;+0#0000000&| @43
4+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@10|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|5+0#e000002&|;+0#0000000&| @52
5+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@7|}| @63
6+|~+0#4040ff13&| @73
7+|~| @73
8+|~| @73
9+|~| @73
10+|X+3#0000000&|p|r|o|g|r|a|m|2|.|c| @45|1|,|1| @11|A|l@1
11+| +0#0000e05#a8a8a8255@1|v+0#00e0003#ffd7ff255|o|i|d| +0#0000000&|d|o|N+2&#ff404010|o|t+0&#ffd7ff255|h|i|n|g|(|)| |{| @54
12+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@10|i+0#00e0003&|n|t| +0#0000000&|x| |=| |0+0#e000002&|;+0#0000000&| @51
13+| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@10|c+0#00e0003&|h|a|r| +0#0000000&|*|s| |=| |"+0#e000002&|h+2&#ff404010|e|l@1|o|"+0&#ffd7ff255|;+0#0000000&| @43
14+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@10|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|5+0#e000002&|;+0#0000000&| @52
15+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@7|}| @63
16+|~+0#4040ff13&| @73
17+|~| @73
18+|~| @73
19+|X+1#0000000&|p|r|o|g|r|a|m|1|.|c| @45|1|,|1| @11|A|l@1
20+|"+0&&|X|p|r|o|g|r|a|m|2|.|c|"| |5|L|,| |7|6|C| @53
diff -r c1ae47339f5c -r 995925603ea0 src/testdir/test_diffmode.vim
--- a/src/testdir/test_diffmode.vim Sun Sep 15 19:15:04 2019 +0200
+++ b/src/testdir/test_diffmode.vim Sun Sep 15 19:45:03 2019 +0200
@@ -905,6 +905,42 @@
905905 call delete('Xtest_diff_cursorline')
906906 endfunc
907907
908+func Test_diff_with_syntax()
909+ CheckScreendump
910+
911+ let lines =<< trim END
912+ void doNothing() {
913+ int x = 0;
914+ char *s = "hello";
915+ return 5;
916+ }
917+ END
918+ call writefile(lines, 'Xprogram1.c')
919+ let lines =<< trim END
920+ void doSomething() {
921+ int x = 0;
922+ char *s = "there";
923+ return 5;
924+ }
925+ END
926+ call writefile(lines, 'Xprogram2.c')
927+
928+ let lines =<< trim END
929+ edit Xprogram1.c
930+ diffsplit Xprogram2.c
931+ END
932+ call writefile(lines, 'Xtest_diff_syntax')
933+ let buf = RunVimInTerminal('-S Xtest_diff_syntax', {})
934+
935+ call VerifyScreenDump(buf, 'Test_diff_syntax_1', {})
936+
937+ " clean up
938+ call StopVimInTerminal(buf)
939+ call delete('Xtest_diff_syntax')
940+ call delete('Xprogram1.c')
941+ call delete('Xprogram2.c')
942+endfunc
943+
908944 func Test_diff_of_diff()
909945 CheckScreendump
910946 CheckFeature rightleft
diff -r c1ae47339f5c -r 995925603ea0 src/version.c
--- a/src/version.c Sun Sep 15 19:15:04 2019 +0200
+++ b/src/version.c Sun Sep 15 19:45:03 2019 +0200
@@ -758,6 +758,8 @@
758758 static int included_patches[] =
759759 { /* Add new patch number below this line */
760760 /**/
761+ 2041,
762+/**/
761763 2040,
762764 /**/
763765 2039,
Show on old repository browser