diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-11-30 10:07:24 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-11-30 10:15:48 +0800 |
commit | 22622df950fe90abcaaf2e6710cd6cd9451cdc34 (patch) | |
tree | f99301f305306dcfa08db2bce4638f42449989aa /src/nvim/indent.c | |
parent | e0c7b8955d0193ebbc7df703179ecb035f73fec7 (diff) | |
download | rneovim-22622df950fe90abcaaf2e6710cd6cd9451cdc34.tar.gz rneovim-22622df950fe90abcaaf2e6710cd6cd9451cdc34.tar.bz2 rneovim-22622df950fe90abcaaf2e6710cd6cd9451cdc34.zip |
vim-patch:8.2.5108: retab test disabled because it hangs on MS-Windows
Problem: Retab test disabled because it hangs on MS-Windows.
Solution: Also set got_int at the other place a overlong text is detected.
https://github.com/vim/vim/commit/308660bd263367a4f1a75498cbd2e29cade47f4d
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/indent.c')
-rw-r--r-- | src/nvim/indent.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/nvim/indent.c b/src/nvim/indent.c index 32cdf6f2d6..0ffa152af7 100644 --- a/src/nvim/indent.c +++ b/src/nvim/indent.c @@ -918,6 +918,16 @@ bool may_do_si(void) return curbuf->b_p_si && !curbuf->b_p_cin && *curbuf->b_p_inde == NUL && !p_paste; } +/// Give a "resulting text too long" error and maybe set got_int. +static void emsg_text_too_long(void) +{ + emsg(_(e_resulting_text_too_long)); + // when not inside a try/catch set got_int to break out of any loop + if (trylevel == 0) { + got_int = true; + } +} + /// ":retab". void ex_retab(exarg_T *eap) { @@ -1009,7 +1019,7 @@ void ex_retab(exarg_T *eap) old_len = (long)strlen(ptr); const long new_len = old_len - col + start_col + len + 1; if (new_len <= 0 || new_len >= MAXCOL) { - emsg(_(e_resulting_text_too_long)); + emsg_text_too_long(); break; } new_line = xmalloc((size_t)new_len); @@ -1045,12 +1055,7 @@ void ex_retab(exarg_T *eap) } vcol += win_chartabsize(curwin, ptr + col, (colnr_T)vcol); if (vcol >= MAXCOL) { - emsg(_(e_resulting_text_too_long)); - // when not inside a try/catch set got_int to break out of any - // loop - if (trylevel == 0) { - got_int = true; - } + emsg_text_too_long(); break; } col += utfc_ptr2len(ptr + col); |