[vim/vim] Trigger WinScrolled while fold is opened or closed (Issue #21127)

7 views
Skip to first unread message

Mao-Yining

unread,
Aug 22, 2026, 12:37:41 PMAug 22
to vim/vim, Subscribed
mao-yining created an issue (vim/vim#21127)

I want to trigger a function while newline appears.

But I can't find a way to trigger it while open and closeing folds

Additional context:

To solve the problem that signs are too slow. So only place signs that canbe seen.

export def Render(bufnr: number = bufnr()): void
  var sy: Signify = bufnr->getbufvar('sy', null_object)
  if sy == null_object
    return
  endif
  sign_unplace('Signify', {buffer: bufnr})
  var signlist = sy.signs
  if empty(signlist)
    return
  endif
  var winid = bufnr->bufwinid()
  if winid == -1
    return
  endif
  var wininfo = winid->getwininfo()[0]
  var botline: number = wininfo.botline + 1 # botline should +1 for wraped line
  var priority: number = get(g:, 'signify_priority', 10)
  var lnum: number = wininfo.topline - 1
  while lnum < botline
    ++lnum
    var end = foldclosedend(lnum)
    if end != -1
      lnum = end
      continue
    endif
    var name = signlist->get(lnum, null_string)
    if name != null_string
      sign_place(0, 'Signify', name, bufnr, {lnum: lnum, priority: priority})
    endif
  endwhile
enddef


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/21127@github.com>

dezza

unread,
Sep 1, 2026, 3:45:12 AM (6 days ago) Sep 1
to vim/vim, Subscribed
dezza left a comment (vim/vim#21127)

I don't think it cleanly maps to WinScrolled. If this was changed, then many other functions which change buffer display would also and it would explode in complexity, opinions, etc.

Rather add FoldOpen, FoldClose autocmd.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/21127/5490637955@github.com>

Mao-Yining

unread,
Sep 1, 2026, 3:53:45 AM (6 days ago) Sep 1
to vim/vim, Subscribed
mao-yining left a comment (vim/vim#21127)

I don't think it cleanly maps to WinScrolled. If this was changed, then many other functions which change buffer display would also and it would explode in complexity, opinions, etc.

FoldChanged is well too. I choose WinScrolled just because it is triggered while some line is hidden and some line is shown.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/21127/5490749920@github.com>

dezza

unread,
Sep 1, 2026, 4:54:33 AM (6 days ago) Sep 1
to vim/vim, Subscribed
dezza left a comment (vim/vim#21127)

FoldChanged -> v:event could tell name of fold, open/closed etc.

I like that.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/21127/5491475604@github.com>

Reply all
Reply to author
Forward
0 new messages