aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/textformat.c2
-rw-r--r--test/old/testdir/test_termdebug.vim22
2 files changed, 15 insertions, 9 deletions
diff --git a/src/nvim/textformat.c b/src/nvim/textformat.c
index 105b75f224..564934aa51 100644
--- a/src/nvim/textformat.c
+++ b/src/nvim/textformat.c
@@ -940,7 +940,7 @@ void format_lines(linenr_T line_count, bool avoid_fex)
// length of a line to force formatting: 3 * 'tw'
const int max_len = comp_textwidth(true) * 3;
- // check for 'q', '2' and '1' in 'formatoptions'
+ // check for 'q', '2', 'n' and 'w' in 'formatoptions'
const bool do_comments = has_format_option(FO_Q_COMS); // format comments
int do_comments_list = 0; // format comments with 'n' or '2'
const bool do_second_indent = has_format_option(FO_Q_SECOND);
diff --git a/test/old/testdir/test_termdebug.vim b/test/old/testdir/test_termdebug.vim
index ab1a76000a..f13850cb62 100644
--- a/test/old/testdir/test_termdebug.vim
+++ b/test/old/testdir/test_termdebug.vim
@@ -97,16 +97,22 @@ func Test_termdebug_basic()
bw!
endif
set columns=160
+ let winw = winwidth(0)
Var
- call assert_equal(winnr(), winnr('$') - 1)
- call assert_equal(winlayout(), ['col', [['leaf', 1002], ['leaf', 1001], ['row', [['leaf', 1003 + cn], ['leaf', 1000]]]]])
- let cn += 1
- bw!
+ if winwidth(0) < winw
+ call assert_equal(winnr(), winnr('$') - 1)
+ call assert_equal(winlayout(), ['col', [['leaf', 1002], ['leaf', 1001], ['row', [['leaf', 1003 + cn], ['leaf', 1000]]]]])
+ let cn += 1
+ bw!
+ endif
+ let winw = winwidth(0)
Asm
- call assert_equal(winnr(), winnr('$') - 1)
- call assert_equal(winlayout(), ['col', [['leaf', 1002], ['leaf', 1001], ['row', [['leaf', 1003 + cn], ['leaf', 1000]]]]])
- let cn += 1
- bw!
+ if winwidth(0) < winw
+ call assert_equal(winnr(), winnr('$') - 1)
+ call assert_equal(winlayout(), ['col', [['leaf', 1002], ['leaf', 1001], ['row', [['leaf', 1003 + cn], ['leaf', 1000]]]]])
+ let cn += 1
+ bw!
+ endif
set columns&
wincmd t