aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuuk van Baal <luukvbaal@gmail.com>2023-04-26 20:30:39 +0200
committerLuuk van Baal <luukvbaal@gmail.com>2023-05-02 13:11:46 +0200
commit2918720addd3837abcf06f457e8e2cf674ece5e7 (patch)
treea0102ec4094fd7bfeb23d33e00889de0e003c6ac
parent34a4f3729ce4a047ae945238276c8e2dabc38048 (diff)
downloadrneovim-2918720addd3837abcf06f457e8e2cf674ece5e7.tar.gz
rneovim-2918720addd3837abcf06f457e8e2cf674ece5e7.tar.bz2
rneovim-2918720addd3837abcf06f457e8e2cf674ece5e7.zip
vim-patch:9.0.0681: "<<<" shows for 'smoothscroll' even when 'showbreak is set
Problem: "<<<" shows for 'smoothscroll' even when 'showbreak is set. Solution: When 'showbreak' is set do not display "<<<". https://github.com/vim/vim/commit/0937b9fb244949b7ce9bfcf8398d7495b9b6aa85 Co-authored-by: Bram Moolenaar <Bram@vim.org>
-rw-r--r--src/nvim/grid.c7
-rw-r--r--test/old/testdir/test_breakindent.vim2
-rw-r--r--test/old/testdir/test_listlbr_utf8.vim2
3 files changed, 6 insertions, 5 deletions
diff --git a/src/nvim/grid.c b/src/nvim/grid.c
index 2c548e11f1..0ceaeaa8b2 100644
--- a/src/nvim/grid.c
+++ b/src/nvim/grid.c
@@ -22,7 +22,7 @@
#include "nvim/highlight.h"
#include "nvim/log.h"
#include "nvim/message.h"
-#include "nvim/option_defs.h"
+#include "nvim/option.h"
#include "nvim/types.h"
#include "nvim/ui.h"
#include "nvim/vim.h"
@@ -530,8 +530,9 @@ void grid_put_linebuf(ScreenGrid *grid, int row, int coloff, int endcol, int cle
max_off_from = linebuf_size;
max_off_to = grid->line_offset[row] + (size_t)grid->cols;
- if (topline && wp->w_skipcol > 0) {
- // Take care of putting "<<<" on the first line for 'smoothscroll'.
+ if (topline && wp->w_skipcol > 0 && *get_showbreak_value(wp) == NUL) {
+ // Take care of putting "<<<" on the first line for 'smoothscroll'
+ // when 'showbreak' is not set.
for (int i = 0; i < 3; i++) {
schar_from_ascii(linebuf_char[i], '<');
linebuf_attr[i] = HL_ATTR(HLF_AT);
diff --git a/test/old/testdir/test_breakindent.vim b/test/old/testdir/test_breakindent.vim
index 9cc398f64a..3cbc1f4900 100644
--- a/test/old/testdir/test_breakindent.vim
+++ b/test/old/testdir/test_breakindent.vim
@@ -700,7 +700,7 @@ func Test_breakindent19_sbr_nextpage()
norm! 5gj
let lines = s:screen_lines(1, 20)
let expect = [
- \ "<<<aaaaaaaaaaaaaaaaa",
+ \ ">aaaaaaaaaaaaaaaaaaa",
\ ">aaaaaaaaaaaaaaaaaaa",
\ ">aaaaaaaaaaaaaaaaaaa",
\ ]
diff --git a/test/old/testdir/test_listlbr_utf8.vim b/test/old/testdir/test_listlbr_utf8.vim
index 47683696d1..15b248964f 100644
--- a/test/old/testdir/test_listlbr_utf8.vim
+++ b/test/old/testdir/test_listlbr_utf8.vim
@@ -167,7 +167,7 @@ func Test_visual_block_and_selection_exclusive()
exe "norm! $3B\<C-v>eAx\<Esc>"
let lines = s:screen_lines([1, 10], winwidth(0))
let expect = [
-\ "<<<obar foobar ",
+\ "+foobar foobar ",
\ "+foobar foobar ",
\ "+foobar foobar ",
\ "+foobar foobar ",