Merge #6254 'vim-patch:7.4.2135,7.4.2144,7.4.2151'

This commit is contained in:
Justin M. Keyes
2017-03-15 14:10:56 +01:00
6 changed files with 16 additions and 26 deletions

View File

@@ -2,7 +2,7 @@
" You can also use this as a start for your own set of menus. " You can also use this as a start for your own set of menus.
" "
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2014 May 22 " Last Change: 2016 Jul 27
" Note that ":an" (short for ":anoremenu") is often used to make a menu work " Note that ":an" (short for ":anoremenu") is often used to make a menu work
" in all modes and avoid side effects from mappings defined by the user. " in all modes and avoid side effects from mappings defined by the user.

View File

@@ -129,7 +129,7 @@ void diff_buf_add(buf_T *buf)
} }
} }
EMSGN(_("E96: Can not diff more than %" PRId64 " buffers"), DB_COUNT); EMSGN(_("E96: Cannot diff more than %" PRId64 " buffers"), DB_COUNT);
} }
/// Find buffer "buf" in the list of diff buffers for the current tab page. /// Find buffer "buf" in the list of diff buffers for the current tab page.

View File

@@ -564,11 +564,8 @@ static int qf_get_next_file_line(qfstate_T *state)
bool discard = false; bool discard = false;
state->linelen = STRLEN(IObuff); state->linelen = STRLEN(IObuff);
if (state->linelen == IOSIZE - 1 && !(IObuff[state->linelen - 1] == '\n' if (state->linelen == IOSIZE - 1
#ifdef USE_CRNL && !(IObuff[state->linelen - 1] == '\n')) {
|| IObuff[state->linelen - 1] == '\r'
#endif
)) { // NOLINT(whitespace/parens)
// The current line exceeds IObuff, continue reading using growbuf // The current line exceeds IObuff, continue reading using growbuf
// until EOL or LINE_MAXLEN bytes is read. // until EOL or LINE_MAXLEN bytes is read.
if (state->growbuf == NULL) { if (state->growbuf == NULL) {
@@ -587,11 +584,7 @@ static int qf_get_next_file_line(qfstate_T *state)
} }
state->linelen = STRLEN(state->growbuf + growbuflen); state->linelen = STRLEN(state->growbuf + growbuflen);
growbuflen += state->linelen; growbuflen += state->linelen;
if (state->growbuf[growbuflen - 1] == '\n' if (state->growbuf[growbuflen - 1] == '\n') {
#ifdef USE_CRNL
|| state->growbuf[growbuflen - 1] == '\r'
#endif
) {
break; break;
} }
if (state->growbufsiz == LINE_MAXLEN) { 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. // discard everything until EOL or EOF is reached.
if (fgets((char *)IObuff, IOSIZE, state->fd) == NULL if (fgets((char *)IObuff, IOSIZE, state->fd) == NULL
|| STRLEN(IObuff) < IOSIZE - 1 || STRLEN(IObuff) < IOSIZE - 1
|| IObuff[IOSIZE - 1] == '\n' || IObuff[IOSIZE - 1] == '\n') {
#ifdef USE_CRNL
|| IObuff[IOSIZE - 1] == '\r'
#endif
) {
break; break;
} }
} }
@@ -655,12 +644,12 @@ static int qf_get_nextline(qfstate_T *state)
if (state->linelen > 0 && state->linebuf[state->linelen - 1] == '\n') { if (state->linelen > 0 && state->linebuf[state->linelen - 1] == '\n') {
state->linebuf[state->linelen - 1] = NUL; state->linebuf[state->linelen - 1] = NUL;
}
#ifdef USE_CRNL #ifdef USE_CRNL
if (state->linelen > 0 && state->linebuf[state->linelen - 1] == '\r') { if (state->linelen > 1 && state->linebuf[state->linelen - 2] == '\r') {
state->linebuf[state->linelen - 1] = NUL; state->linebuf[state->linelen - 2] = NUL;
} }
#endif #endif
}
remove_bom(state->linebuf); remove_bom(state->linebuf);

View File

@@ -389,6 +389,7 @@ endfunction
function Test_helpgrep() function Test_helpgrep()
call s:test_xhelpgrep('c') call s:test_xhelpgrep('c')
helpclose
call s:test_xhelpgrep('l') call s:test_xhelpgrep('l')
endfunc endfunc

View File

@@ -289,14 +289,14 @@ static int included_patches[] = {
// 2154 NA // 2154 NA
// 2153 NA // 2153 NA
// 2152, // 2152,
// 2151, 2151,
// 2150 NA // 2150 NA
2149, 2149,
2148, 2148,
2147, 2147,
2146, 2146,
// 2145 NA // 2145 NA
// 2144, 2144,
2143, 2143,
2142, 2142,
2141, 2141,
@@ -305,7 +305,7 @@ static int included_patches[] = {
// 2138 NA // 2138 NA
2137, 2137,
2136, 2136,
// 2135, 2135,
2134, 2134,
// 2133 NA // 2133 NA
// 2132 NA // 2132 NA

View File

@@ -1,5 +1,5 @@
-- Test for *sub-replace-special* and *sub-replace-expression* on substitue(). -- Test for *sub-replace-special* and *sub-replace-expression* on substitute().
-- Test for submatch() on substitue(). -- Test for submatch() on substitute().
-- Test for *:s%* on :substitute. -- Test for *:s%* on :substitute.
local helpers = require('test.functional.helpers')(after_each) local helpers = require('test.functional.helpers')(after_each)