[vim/vim] Session restoration fails on options using lambdas (PR #21161)

10 views
Skip to first unread message

MiguelBarro

unread,
Aug 26, 2026, 9:06:19 PM (9 days ago) Aug 26
to vim/vim, Subscribed

Some plugins (like the builtin comment one) set options to lambdas for convenience (comment.vim does that with 'operatorfunc').

In that case :mksession will include a set operatorfunc=function('<lambda>xxxx') . Trying to source the session file will throw a E700: Unknown function: <lambda>xxxx because the lambda is either not there or has a different number associated.
In the case of comment plugin the lambda is defined from the mappings and is not available on plugin load.

This pull request prevents those operators associated with lambdas from being recorded in the session.


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/21161

Commit Summary

  • 6adc4a5 Testing that options relying on lambdas are ignored in the session file
  • f625fd5 fix: prevent lambdas from been stored as settings. Loading a session with lambdas fails because they are not defined

File Changes

(2 files)

Patch Links:


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/pull/21161@github.com>

Christian Brabandt

unread,
Sep 2, 2026, 5:04:29 PM (2 days ago) Sep 2
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#21161)

thanks


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/pull/21161/c5516366458@github.com>

Reply all
Reply to author
Forward
0 new messages