summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0562
blob: af58aac6884e08d7f0b217fb4663c9ecf472201e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0562
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.0562
Problem:    Parsing of 'diffopt' is slightly wrong.
Solution:   Fix the parsing and add a test. (Jason Franklin, Christian
            Brabandt)
Files:	    src/diff.c, src/testdir/test_diffmode.vim,
            src/testdir/dumps/Test_diff_09.dump,
            src/testdir/dumps/Test_diff_11.dump, src/testdir/screendump.vim


*** ../vim-8.1.0561/src/diff.c	2018-11-05 21:21:29.800286334 +0100
--- src/diff.c	2018-12-04 22:21:18.163764693 +0100
***************
*** 2173,2178 ****
--- 2173,2179 ----
      int		diff_flags_new = 0;
      int		diff_foldcolumn_new = 2;
      long	diff_algorithm_new = 0;
+     long	diff_indent_heuristic = 0;
      tabpage_T	*tp;
  
      p = p_dip;
***************
*** 2236,2242 ****
  	else if (STRNCMP(p, "indent-heuristic", 16) == 0)
  	{
  	    p += 16;
! 	    diff_algorithm_new |= XDF_INDENT_HEURISTIC;
  	}
  	else if (STRNCMP(p, "internal", 8) == 0)
  	{
--- 2237,2243 ----
  	else if (STRNCMP(p, "indent-heuristic", 16) == 0)
  	{
  	    p += 16;
! 	    diff_indent_heuristic = XDF_INDENT_HEURISTIC;
  	}
  	else if (STRNCMP(p, "internal", 8) == 0)
  	{
***************
*** 2276,2281 ****
--- 2277,2284 ----
  	    ++p;
      }
  
+     diff_algorithm_new |= diff_indent_heuristic;
+ 
      /* Can't have both "horizontal" and "vertical". */
      if ((diff_flags_new & DIFF_HORIZONTAL) && (diff_flags_new & DIFF_VERTICAL))
  	return FAIL;
*** ../vim-8.1.0561/src/testdir/test_diffmode.vim	2018-11-01 21:14:50.541818034 +0100
--- src/testdir/test_diffmode.vim	2018-12-04 22:21:18.163764693 +0100
***************
*** 813,820 ****
    call term_sendkeys(buf, ":set diffopt+=internal\<cr>")
    call VerifyScreenDump(buf, 'Test_diff_10', {})
  
!   call term_sendkeys(buf, ":set diffopt+=indent-heuristic\<cr>")
!   call VerifyScreenDump(buf, 'Test_diff_11', {})
  
    " Test 12: diff the same file
    call WriteDiffFiles(buf, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
--- 813,828 ----
    call term_sendkeys(buf, ":set diffopt+=internal\<cr>")
    call VerifyScreenDump(buf, 'Test_diff_10', {})
  
!   " Leave trailing : at commandline!
!   call term_sendkeys(buf, ":set diffopt+=indent-heuristic\<cr>:\<cr>")
!   call VerifyScreenDump(buf, 'Test_diff_11', {}, 'one')
!   " shouldn't matter, if indent-algorithm comes before or after the algorithm
!   call term_sendkeys(buf, ":set diffopt&\<cr>")
!   call term_sendkeys(buf, ":set diffopt+=indent-heuristic,algorithm:patience\<cr>:\<cr>")
!   call VerifyScreenDump(buf, 'Test_diff_11', {}, 'two')
!   call term_sendkeys(buf, ":set diffopt&\<cr>")
!   call term_sendkeys(buf, ":set diffopt+=algorithm:patience,indent-heuristic\<cr>:\<cr>")
!   call VerifyScreenDump(buf, 'Test_diff_11', {}, 'three')
  
    " Test 12: diff the same file
    call WriteDiffFiles(buf, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
*** ../vim-8.1.0561/src/testdir/dumps/Test_diff_09.dump	2018-09-10 17:50:32.713306941 +0200
--- src/testdir/dumps/Test_diff_09.dump	2018-12-04 22:21:18.163764693 +0100
***************
*** 17,20 ****
  | +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|{| @29||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|{| @29
  | +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@7|p|r|i|n|t|f|(|"|Y|o|u|r| |a|n|s|w|e|r| |i|s|:| |"|)|;||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34
  |X+3#0000000#ffffff0|f|i|l|e|1| @12|1|,|1| @11|T|o|p| |X+1&&|f|i|l|e|2| @12|1|,|1| @11|T|o|p
! |:+0&&|s|e|t| |d|i|f@1|o|p|t|+|=|a|l|g|o|r|i|t|h|m|:|p|a|t|i|e|n|c|e| @42
--- 17,20 ----
  | +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|{| @29||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|{| @29
  | +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@7|p|r|i|n|t|f|(|"|Y|o|u|r| |a|n|s|w|e|r| |i|s|:| |"|)|;||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34
  |X+3#0000000#ffffff0|f|i|l|e|1| @12|1|,|1| @11|T|o|p| |X+1&&|f|i|l|e|2| @12|1|,|1| @11|T|o|p
! |:+0&&|s|e|t| |d|i|f@1|o|p|t|+|=|a|l|g|o|r|i|t|h|m|:|h|i|s|t|o|g|r|a|m| @41
*** ../vim-8.1.0561/src/testdir/dumps/Test_diff_11.dump	2018-09-10 17:50:32.713306941 +0200
--- src/testdir/dumps/Test_diff_11.dump	2018-12-04 22:21:18.163764693 +0100
***************
*** 17,20 ****
  | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
  | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
  |X+3#0000000&|f|i|l|e|1| @12|1|,|0|-|1| @9|A|l@1| |X+1&&|f|i|l|e|2| @12|1|,|0|-|1| @9|A|l@1
! |:+0&&|s|e|t| |d|i|f@1|o|p|t|+|=|i|n|d|e|n|t|-|h|e|u|r|i|s|t|i|c| @44
--- 17,20 ----
  | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
  | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
  |X+3#0000000&|f|i|l|e|1| @12|1|,|0|-|1| @9|A|l@1| |X+1&&|f|i|l|e|2| @12|1|,|0|-|1| @9|A|l@1
! |:+0&&| @73
*** ../vim-8.1.0561/src/testdir/screendump.vim	2018-09-09 22:02:21.165859748 +0200
--- src/testdir/screendump.vim	2018-12-04 22:21:18.163764693 +0100
***************
*** 103,108 ****
--- 103,110 ----
  
    let i = 0
    while 1
+     " leave some time for updating the original window
+     sleep 10m
      call delete(testfile)
      call term_dumpwrite(a:buf, testfile, a:options)
      if readfile(reference) == readfile(testfile)
***************
*** 113,124 ****
        " Leave the test file around for inspection.
        let msg = 'See dump file difference: call term_dumpdiff("' . testfile . '", "' . reference . '")'
        if a:0 == 1
! 	let msg = a:1 . ': ' . msg
        endif
        call assert_report(msg)
        return 1
      endif
-     sleep 10m
      let i += 1
    endwhile
    return 0
--- 115,125 ----
        " Leave the test file around for inspection.
        let msg = 'See dump file difference: call term_dumpdiff("' . testfile . '", "' . reference . '")'
        if a:0 == 1
!         let msg = a:1 . ': ' . msg
        endif
        call assert_report(msg)
        return 1
      endif
      let i += 1
    endwhile
    return 0
*** ../vim-8.1.0561/src/version.c	2018-12-03 20:49:58.767291066 +0100
--- src/version.c	2018-12-04 22:24:03.973785303 +0100
***************
*** 794,795 ****
--- 794,797 ----
  {   /* Add new patch number below this line */
+ /**/
+     562,
  /**/

-- 
SOLDIER: What?  Ridden on a horse?
ARTHUR:  Yes!
SOLDIER: You're using coconuts!
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// 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    ///