[vim/vim] conceal character of matchadd() displayed too many times (#7268)

29 views
Skip to first unread message

lacygoill

unread,
Nov 6, 2020, 12:20:11 PM11/6/20
to vim/vim, Subscribed

Describe the bug

Sometimes, the conceal character used in a match installed by matchadd() is displayed too many times.

To Reproduce

Run this shell command:

vim -Nu NONE -S <(cat <<'EOF'
    let lines =<< trim END
        aaa|bbb|ccc
        aaa|bbb|ccc
        aaa|bbb|ccc
    END
    call setline(1, lines)
    call matchadd('Conceal', '^..', 10, -1, #{conceal: 'X'})
    syn match foobar '^.'
    setl cocu=n cole=1
EOF
)

The conceal character X is displayed twice.

Expected behavior

The conceal character X is displayed once.

Environment

  • Vim version: 8.2 Included patches: 1-1962
  • OS: Ubuntu 16.04.7 LTS
  • Terminal: xterm(361)

Additional context

Regression introduced in 8.0.0672.


I found this issue while trying to conceal the middle column in a location window, when the location list has been set by an :ltag command.

syn on
let items = [#{lnum: 1, col: 1, filename: '/tmp/file', text: 'some text'}]
call setqflist([], ' ', #{items: items})
copen
call matchadd('Conceal', '|.\{-}|', 10, -1, #{conceal: '|'})
setl cocu=n cole=1

This time, the conceal character (|) is displayed 3 times, instead of once.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Bram Moolenaar

unread,
May 8, 2022, 4:26:02 PM5/8/22
to vim/vim, Subscribed

Closed #7268 via 9830db6.


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/7268/issue_event/6569056145@github.com>

Reply all
Reply to author
Forward
0 new messages