diff options
author | lonerover <pathfinder1644@yahoo.com> | 2017-03-11 18:31:46 +0800 |
---|---|---|
committer | lonerover <pathfinder1644@yahoo.com> | 2017-03-11 19:02:10 +0800 |
commit | 6311ec3a633692dbc353c928c6c133d8204589d4 (patch) | |
tree | a710c7ca7e719cd0122536185aae53eab8d4ae05 | |
parent | 3de33401324433b3a0ba3d217f0fae2fa3f6731f (diff) | |
download | rneovim-6311ec3a633692dbc353c928c6c133d8204589d4.tar.gz rneovim-6311ec3a633692dbc353c928c6c133d8204589d4.tar.bz2 rneovim-6311ec3a633692dbc353c928c6c133d8204589d4.zip |
vim-patch:7.4.2144
Problem: On MS-Windows quickix does not handle a line with 1023 bytes
ending in CR-LF properly.
Solution: Don't consider CR a line break. (Ken Takata)
https://github.com/vim/vim/commit/796aa9c804f09276bd3cc45123f4a191a001dec2
-rw-r--r-- | src/nvim/quickfix.c | 27 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
2 files changed, 9 insertions, 20 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index c4b8d266cf..8406dfc157 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -564,11 +564,8 @@ static int qf_get_next_file_line(qfstate_T *state) bool discard = false; state->linelen = STRLEN(IObuff); - if (state->linelen == IOSIZE - 1 && !(IObuff[state->linelen - 1] == '\n' -#ifdef USE_CRNL - || IObuff[state->linelen - 1] == '\r' -#endif - )) { // NOLINT(whitespace/parens) + if (state->linelen == IOSIZE - 1 + && !(IObuff[state->linelen - 1] == '\n')) { // NOLINT(whitespace/parens) // The current line exceeds IObuff, continue reading using growbuf // until EOL or LINE_MAXLEN bytes is read. if (state->growbuf == NULL) { @@ -587,11 +584,7 @@ static int qf_get_next_file_line(qfstate_T *state) } state->linelen = STRLEN(state->growbuf + growbuflen); growbuflen += state->linelen; - if (state->growbuf[growbuflen - 1] == '\n' -#ifdef USE_CRNL - || state->growbuf[growbuflen - 1] == '\r' -#endif - ) { + if (state->growbuf[growbuflen - 1] == '\n') { break; } if (state->growbufsiz == LINE_MAXLEN) { @@ -609,11 +602,7 @@ static int qf_get_next_file_line(qfstate_T *state) // discard everything until EOL or EOF is reached. if (fgets((char *)IObuff, IOSIZE, state->fd) == NULL || STRLEN(IObuff) < IOSIZE - 1 - || IObuff[IOSIZE - 1] == '\n' -#ifdef USE_CRNL - || IObuff[IOSIZE - 1] == '\r' -#endif - ) { + || IObuff[IOSIZE - 1] == '\n') { break; } } @@ -655,12 +644,12 @@ static int qf_get_nextline(qfstate_T *state) if (state->linelen > 0 && state->linebuf[state->linelen - 1] == '\n') { state->linebuf[state->linelen - 1] = NUL; - } #ifdef USE_CRNL - if (state->linelen > 0 && state->linebuf[state->linelen - 1] == '\r') { - state->linebuf[state->linelen - 1] = NUL; - } + if (state->linelen > 1 && state->linebuf[state->linelen - 2] == '\r') { + state->linebuf[state->linelen - 2] = NUL; + } #endif + } remove_bom(state->linebuf); diff --git a/src/nvim/version.c b/src/nvim/version.c index e39ba83e8b..0eadd39182 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -296,7 +296,7 @@ static int included_patches[] = { 2147, 2146, // 2145 NA - // 2144, + 2144, 2143, 2142, 2141, |