mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-12 18:24:35 +02:00
plugins: Introduce helpers.defaultNullOpts.mkLuaFn (#855)
This allows to avoid calling `mkRaw` on lua functions, as they will get applied automatically. This could also help in the future to refactor the use of Lua code to make it more user-friendly.
This commit is contained in:
parent
b38dbdb0dc
commit
1d8e7906c9
30 changed files with 140 additions and 119 deletions
|
@ -81,12 +81,12 @@ in {
|
|||
Restore session for upcoming cwd on cwd change.
|
||||
'';
|
||||
|
||||
preCwdChangedHook = helpers.mkNullOrOption types.str ''
|
||||
preCwdChangedHook = helpers.defaultNullOpts.mkLuaFn "nil" ''
|
||||
lua function hook.
|
||||
This is called after auto_session code runs for the `DirChangedPre` autocmd.
|
||||
'';
|
||||
|
||||
postCwdChangedHook = helpers.mkNullOrOption types.str ''
|
||||
postCwdChangedHook = helpers.defaultNullOpts.mkLuaFn "nil" ''
|
||||
lua function hook.
|
||||
This is called after auto_session code runs for the `DirChanged` autocmd.
|
||||
'';
|
||||
|
@ -160,8 +160,8 @@ in {
|
|||
then
|
||||
with cfg.cwdChangeHandling; {
|
||||
restore_upcoming_session = restoreUpcomingSession;
|
||||
pre_cwd_changed_hook = helpers.mkRaw preCwdChangedHook;
|
||||
post_cwd_changed_hook = helpers.mkRaw postCwdChangedHook;
|
||||
pre_cwd_changed_hook = preCwdChangedHook;
|
||||
post_cwd_changed_hook = postCwdChangedHook;
|
||||
}
|
||||
else cfg.cwdChangeHandling;
|
||||
bypass_session_save_file_types = cfg.bypassSessionSaveFileTypes;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue