mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 11:28:22 +00:00
vim-patch:7.4.643
Problem: Using the default file format for Mac files. (Issue 77)
Solution: Reset the try_mac counter in the right place. (Oswald)
c6b7217ff5
This commit is contained in:
@@ -1543,12 +1543,12 @@ rewind_retry:
|
|||||||
if (fileformat == EOL_UNKNOWN) {
|
if (fileformat == EOL_UNKNOWN) {
|
||||||
/* First try finding a NL, for Dos and Unix */
|
/* First try finding a NL, for Dos and Unix */
|
||||||
if (try_dos || try_unix) {
|
if (try_dos || try_unix) {
|
||||||
for (p = ptr; p < ptr + size; ++p) {
|
// Reset the carriage return counter.
|
||||||
// Reset the carriage return counter.
|
if (try_mac) {
|
||||||
if (try_mac) {
|
try_mac = 1;
|
||||||
try_mac = 1;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
for (p = ptr; p < ptr + size; ++p) {
|
||||||
if (*p == NL) {
|
if (*p == NL) {
|
||||||
if (!try_unix
|
if (!try_unix
|
||||||
|| (try_dos && p > ptr && p[-1] == CAR))
|
|| (try_dos && p > ptr && p[-1] == CAR))
|
||||||
|
@@ -7,32 +7,27 @@ STARTTEST
|
|||||||
:" first write three test files, one in each format
|
:" first write three test files, one in each format
|
||||||
:set fileformat=unix
|
:set fileformat=unix
|
||||||
:set fileformats=
|
:set fileformats=
|
||||||
:/^1/w! XX1
|
|
||||||
:/^2/w! XX2
|
|
||||||
:/^3/w! XX3
|
|
||||||
:/^4/w! XX4
|
|
||||||
:/^5/w! XX5
|
|
||||||
:/^6/w! XX6
|
|
||||||
:/^7/w! XX7
|
|
||||||
:/^8/w! XX8
|
|
||||||
:/^9/w! XX9
|
|
||||||
:/^10/w! XX10
|
|
||||||
:/^unix/;/eof/-1w! XXUnix
|
:/^unix/;/eof/-1w! XXUnix
|
||||||
:/^dos/;/eof/-1w! XXDos
|
:/^dos/;/eof/-1w! XXDos
|
||||||
:set bin noeol
|
:set bin noeol
|
||||||
:$w! XXMac
|
:$w! XXMac
|
||||||
|
Gonoeol
|
||||||
|
:$w! XXEol
|
||||||
:set nobin eol
|
:set nobin eol
|
||||||
|
:enew!
|
||||||
:bwipe XXUnix XXDos XXMac
|
:bwipe XXUnix XXDos XXMac
|
||||||
:" create mixed format files
|
:" create mixed format files
|
||||||
:if has("win32")
|
:if has("win32")
|
||||||
: !copy /b XXUnix+XXDos XXUxDs
|
: !copy /b XXUnix+XXDos XXUxDs
|
||||||
: !copy /b XXUnix+XXMac XXUxMac
|
: !copy /b XXUnix+XXMac XXUxMac
|
||||||
: !copy /b XXDos+XXMac XXDosMac
|
: !copy /b XXDos+XXMac XXDosMac
|
||||||
|
: !copy /b XXMac+XXEol XXMacEol
|
||||||
: !copy /b XXUnix+XXDos+XXMac XXUxDsMc
|
: !copy /b XXUnix+XXDos+XXMac XXUxDsMc
|
||||||
:else
|
:else
|
||||||
: !cat XXUnix XXDos >XXUxDs
|
: !cat XXUnix XXDos >XXUxDs
|
||||||
: !cat XXUnix XXMac >XXUxMac
|
: !cat XXUnix XXMac >XXUxMac
|
||||||
: !cat XXDos XXMac >XXDosMac
|
: !cat XXDos XXMac >XXDosMac
|
||||||
|
: !cat XXMac XXEol >XXMacEol
|
||||||
: !cat XXUnix XXDos XXMac >XXUxDsMc
|
: !cat XXUnix XXDos XXMac >XXUxDsMc
|
||||||
:endif
|
:endif
|
||||||
:"
|
:"
|
||||||
@@ -97,26 +92,48 @@ STARTTEST
|
|||||||
:e! XXDosMac
|
:e! XXDosMac
|
||||||
:w! XXtt53
|
:w! XXtt53
|
||||||
:bwipe XXDosMac
|
:bwipe XXDosMac
|
||||||
|
:e! XXEol
|
||||||
|
ggO=&ffs
|
||||||
|
:=&ff
|
||||||
|
:w! XXtt54
|
||||||
|
:bwipe XXEol
|
||||||
:set fileformats=dos,mac
|
:set fileformats=dos,mac
|
||||||
:e! XXUxDs
|
:e! XXUxDs
|
||||||
:w! XXtt61
|
:w! XXtt61
|
||||||
:bwipe XXUxDs
|
:bwipe XXUxDs
|
||||||
:e! XXUxMac
|
:e! XXUxMac
|
||||||
:w! XXtt62
|
ggO=&ffs
|
||||||
|
:=&ff
|
||||||
|
:w! XXtt62
|
||||||
:bwipe XXUxMac
|
:bwipe XXUxMac
|
||||||
:e! XXUxDsMc
|
:e! XXUxDsMc
|
||||||
:w! XXtt63
|
:w! XXtt63
|
||||||
:bwipe XXUxDsMc
|
:bwipe XXUxDsMc
|
||||||
|
:e! XXMacEol
|
||||||
|
ggO=&ffs
|
||||||
|
:=&ff
|
||||||
|
:w! XXtt64
|
||||||
|
:bwipe XXMacEol
|
||||||
:"
|
:"
|
||||||
:" try reading and writing with 'fileformats' set to three formats
|
:" try reading and writing with 'fileformats' set to three formats
|
||||||
:set fileformats=unix,dos,mac
|
:set fileformats=unix,dos,mac
|
||||||
:e! XXUxDsMc
|
:e! XXUxDsMc
|
||||||
:w! XXtt71
|
:w! XXtt71
|
||||||
:bwipe XXUxDsMc
|
:bwipe XXUxDsMc
|
||||||
|
:e! XXEol
|
||||||
|
ggO=&ffs
|
||||||
|
:=&ff
|
||||||
|
:w! XXtt72
|
||||||
|
:bwipe XXEol
|
||||||
:set fileformats=mac,dos,unix
|
:set fileformats=mac,dos,unix
|
||||||
:e! XXUxDsMc
|
:e! XXUxDsMc
|
||||||
:w! XXtt81
|
:w! XXtt81
|
||||||
:bwipe XXUxDsMc
|
:bwipe XXUxDsMc
|
||||||
|
:e! XXEol
|
||||||
|
ggO=&ffs
|
||||||
|
:=&ff
|
||||||
|
:w! XXtt82
|
||||||
|
:bwipe XXEol
|
||||||
:" try with 'binary' set
|
:" try with 'binary' set
|
||||||
:set fileformats=mac,unix,dos
|
:set fileformats=mac,unix,dos
|
||||||
:set binary
|
:set binary
|
||||||
@@ -150,11 +167,15 @@ ggdGaEND:w >>XXtt01
|
|||||||
:w >>XXtt51
|
:w >>XXtt51
|
||||||
:w >>XXtt52
|
:w >>XXtt52
|
||||||
:w >>XXtt53
|
:w >>XXtt53
|
||||||
|
:w >>XXtt54
|
||||||
:w >>XXtt61
|
:w >>XXtt61
|
||||||
:w >>XXtt62
|
:w >>XXtt62
|
||||||
:w >>XXtt63
|
:w >>XXtt63
|
||||||
|
:w >>XXtt64
|
||||||
:w >>XXtt71
|
:w >>XXtt71
|
||||||
|
:w >>XXtt72
|
||||||
:w >>XXtt81
|
:w >>XXtt81
|
||||||
|
:w >>XXtt82
|
||||||
:w >>XXtt91
|
:w >>XXtt91
|
||||||
:w >>XXtt92
|
:w >>XXtt92
|
||||||
:w >>XXtt93
|
:w >>XXtt93
|
||||||
@@ -181,11 +202,15 @@ Go4:$r XXtt41
|
|||||||
Go5:$r XXtt51
|
Go5:$r XXtt51
|
||||||
:$r XXtt52
|
:$r XXtt52
|
||||||
:$r XXtt53
|
:$r XXtt53
|
||||||
|
:$r XXtt54
|
||||||
Go6:$r XXtt61
|
Go6:$r XXtt61
|
||||||
:$r XXtt62
|
:$r XXtt62
|
||||||
:$r XXtt63
|
:$r XXtt63
|
||||||
|
:$r XXtt64
|
||||||
Go7:$r XXtt71
|
Go7:$r XXtt71
|
||||||
|
:$r XXtt72
|
||||||
Go8:$r XXtt81
|
Go8:$r XXtt81
|
||||||
|
:$r XXtt82
|
||||||
Go9:$r XXtt91
|
Go9:$r XXtt91
|
||||||
:$r XXtt92
|
:$r XXtt92
|
||||||
:$r XXtt93
|
:$r XXtt93
|
||||||
@@ -195,17 +220,6 @@ Go10:$r XXUnix
|
|||||||
:qa!
|
:qa!
|
||||||
ENDTEST
|
ENDTEST
|
||||||
|
|
||||||
1
|
|
||||||
2
|
|
||||||
3
|
|
||||||
4
|
|
||||||
5
|
|
||||||
6
|
|
||||||
7
|
|
||||||
8
|
|
||||||
9
|
|
||||||
10
|
|
||||||
|
|
||||||
unix
|
unix
|
||||||
unix
|
unix
|
||||||
eof
|
eof
|
||||||
|
@@ -70,12 +70,16 @@ END
|
|||||||
mac
|
mac
|
||||||
mac
|
mac
|
||||||
|
|
||||||
|
END
|
||||||
|
5
|
||||||
|
unix
|
||||||
unix
|
unix
|
||||||
dos
|
dos
|
||||||
dos
|
dos
|
||||||
END
|
END
|
||||||
unix
|
unix
|
||||||
unix
|
unix
|
||||||
|
dos
|
||||||
dos
|
dos
|
||||||
mac
|
mac
|
||||||
mac
|
mac
|
||||||
@@ -86,6 +90,7 @@ dos
|
|||||||
mac
|
mac
|
||||||
END
|
END
|
||||||
unix,mac:unix
|
unix,mac:unix
|
||||||
|
noeol
|
||||||
END
|
END
|
||||||
6
|
6
|
||||||
unix
|
unix
|
||||||
@@ -93,6 +98,9 @@ dos
|
|||||||
dos
|
dos
|
||||||
dos
|
dos
|
||||||
END
|
END
|
||||||
|
dos,mac:dos
|
||||||
|
unix
|
||||||
|
unix
|
||||||
mac
|
mac
|
||||||
mac
|
mac
|
||||||
|
|
||||||
@@ -100,6 +108,7 @@ dos
|
|||||||
unix
|
unix
|
||||||
unix
|
unix
|
||||||
dos
|
dos
|
||||||
|
dos
|
||||||
mac
|
mac
|
||||||
mac
|
mac
|
||||||
|
|
||||||
|
@@ -645,7 +645,7 @@ static int included_patches[] = {
|
|||||||
646,
|
646,
|
||||||
645,
|
645,
|
||||||
// 644 NA
|
// 644 NA
|
||||||
// 643,
|
643,
|
||||||
642,
|
642,
|
||||||
// 641 NA
|
// 641 NA
|
||||||
640,
|
640,
|
||||||
|
Reference in New Issue
Block a user