mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
tutor: force one sign per line (#14352)
The only thing setting signs in the tutor buffer (buftype=nofile), should be tutor.vim itself. Instead of endlessly piling up new signs per line, just unplace any sign on the line before placing a new one. Closes https://github.com/neovim/neovim/issues/13808 Closes https://github.com/neovim/neovim/pull/13809
This commit is contained in:
parent
4a36ec6da0
commit
ef3f05c432
@ -104,6 +104,10 @@ function! tutor#CheckLine(line)
|
|||||||
if exists('b:tutor_metadata') && has_key(b:tutor_metadata, 'expect')
|
if exists('b:tutor_metadata') && has_key(b:tutor_metadata, 'expect')
|
||||||
let bufn = bufnr('%')
|
let bufn = bufnr('%')
|
||||||
let ctext = getline(a:line)
|
let ctext = getline(a:line)
|
||||||
|
let signs = sign_getplaced('.', {'lnum': a:line})[0].signs
|
||||||
|
if !empty(signs)
|
||||||
|
call sign_unplace('', {'id': signs[0].id})
|
||||||
|
endif
|
||||||
if b:tutor_metadata['expect'][string(a:line)] == -1 || ctext ==# b:tutor_metadata['expect'][string(a:line)]
|
if b:tutor_metadata['expect'][string(a:line)] == -1 || ctext ==# b:tutor_metadata['expect'][string(a:line)]
|
||||||
exe "sign place ".b:tutor_sign_id." line=".a:line." name=tutorok buffer=".bufn
|
exe "sign place ".b:tutor_sign_id." line=".a:line." name=tutorok buffer=".bufn
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user