Mercurial > vim
comparison src/testdir/test_diffmode.vim @ 15900:360c93a884d0 v8.1.0956
patch 8.1.0956: using context:0 in 'diffopt' does not work well
commit https://github.com/vim/vim/commit/b9ddda6c2d98d99c09d58145c1b5b4042a8fd92c
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Feb 19 23:00:50 2019 +0100
patch 8.1.0956: using context:0 in 'diffopt' does not work well
Problem: Using context:0 in 'diffopt' does not work well.
Solution: Make zero context do the same as one line context. (closes https://github.com/vim/vim/issues/4005)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 19 Feb 2019 23:15:05 +0100 |
parents | 9339601e7a31 |
children | dc0801e374e0 |
comparison
equal
deleted
inserted
replaced
15899:55c124755844 | 15900:360c93a884d0 |
---|---|
781 | 781 |
782 " Test 6: Add a line in the middle of file 1, remove on at the end of file 2 | 782 " Test 6: Add a line in the middle of file 1, remove on at the end of file 2 |
783 call WriteDiffFiles(buf, [1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) | 783 call WriteDiffFiles(buf, [1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) |
784 call VerifyBoth(buf, 'Test_diff_06', '') | 784 call VerifyBoth(buf, 'Test_diff_06', '') |
785 | 785 |
786 " Variants on test 6 with different context settings | |
787 call term_sendkeys(buf, ":set diffopt+=context:2\<cr>") | |
788 call VerifyScreenDump(buf, 'Test_diff_06.2', {}) | |
789 call term_sendkeys(buf, ":set diffopt-=context:2\<cr>") | |
790 call term_sendkeys(buf, ":set diffopt+=context:1\<cr>") | |
791 call VerifyScreenDump(buf, 'Test_diff_06.1', {}) | |
792 call term_sendkeys(buf, ":set diffopt-=context:1\<cr>") | |
793 call term_sendkeys(buf, ":set diffopt+=context:0\<cr>") | |
794 call VerifyScreenDump(buf, 'Test_diff_06.0', {}) | |
795 call term_sendkeys(buf, ":set diffopt-=context:0\<cr>") | |
796 | |
786 " Test 7 - 9: Test normal/patience/histogram diff algorithm | 797 " Test 7 - 9: Test normal/patience/histogram diff algorithm |
787 call WriteDiffFiles(buf, ['#include <stdio.h>', '', '// Frobs foo heartily', 'int frobnitz(int foo)', '{', | 798 call WriteDiffFiles(buf, ['#include <stdio.h>', '', '// Frobs foo heartily', 'int frobnitz(int foo)', '{', |
788 \ ' int i;', ' for(i = 0; i < 10; i++)', ' {', ' printf("Your answer is: ");', | 799 \ ' int i;', ' for(i = 0; i < 10; i++)', ' {', ' printf("Your answer is: ");', |
789 \ ' printf("%d\n", foo);', ' }', '}', '', 'int fact(int n)', '{', ' if(n > 1)', ' {', | 800 \ ' printf("%d\n", foo);', ' }', '}', '', 'int fact(int n)', '{', ' if(n > 1)', ' {', |
790 \ ' return fact(n-1) * n;', ' }', ' return 1;', '}', '', 'int main(int argc, char **argv)', | 801 \ ' return fact(n-1) * n;', ' }', ' return 1;', '}', '', 'int main(int argc, char **argv)', |