Skip to content

Commit 8ae1ded

Browse files
L3MON4D3github-actions[bot]
authored andcommitted
Auto generate docs
1 parent e31c33d commit 8ae1ded

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

doc/luasnip.txt

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*luasnip.txt* For NVIM v0.8.0 Last change: 2023 December 27
1+
*luasnip.txt* For NVIM v0.8.0 Last change: 2023 December 31
22

33
==============================================================================
44
Table of Contents *luasnip-table-of-contents*
@@ -2805,6 +2805,23 @@ Load via
28052805
<
28062806

28072807

2808+
RELOADING WHEN EDITING REQUIRE’D FILES ~
2809+
2810+
While the lua-snippet-files will be reloaded on edit, this does not
2811+
automatically happen if a file the snippet-file depends on (eg. via `require`)
2812+
is changed. Since this still may still be desirable, there are two functions
2813+
exposed when a file is loaded by the lua-loader: `ls_tracked_dofile` and
2814+
`ls_tracked_dopackage`. They perform like `dofile` and (almost like) `require`,
2815+
but both register the loaded file internally as a dependency of the
2816+
snippet-file, so it can be reloaded when the loaded file is edited. As stated,
2817+
`ls_tracked_dofile` behaves exactly like `dofile`, but does the dependency-work
2818+
as well. `ls_tracked_dopackage` mimics `require` in that it does not take a
2819+
path, but a module-name like `"luasnip.loaders.from_lua"`, and then searches
2820+
the `runtimepath/lua`-directories, and path and cpath for the module. Unlike
2821+
`require`, the file will not be cached, since that would complicate the
2822+
reload-on-edit-behaviour.
2823+
2824+
28082825
EDIT_SNIPPETS *luasnip-loaders-edit_snippets*
28092826

28102827
To easily edit snippets for the current session, the files loaded by any loader

0 commit comments

Comments
 (0)