You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: mini.nvim/CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,12 @@ There are following change types:
44
44
45
45
The previous "reset by explicitly setting initial background color" behavior is available by setting the new `opts.explicit_reset` option to `true`.
46
46
47
+
### Expand {#v0.18.0-mini.misc-expand}
48
+
49
+
- Add `safely()` to execute a function reporting its possible error as warning. It can also postpone execution until certain condition (like event, fixed delay, etc.).
50
+
51
+
It is intended to be a future replacement for `MiniDeps.now()` and `MiniDeps.later()`.
-`'filetype:<filetypes>'` - same as `'event:FileType~<filetypes>'`, but follow
329
+
successful function execution with [filetype-detect](https://neovim.io/doc/user/helptag.html?tag=filetype-detect) for all normal buffers
330
+
(if new [ftdetect](https://neovim.io/doc/user/helptag.html?tag=ftdetect) scripts were added) and sourcing [ftplugin](https://neovim.io/doc/user/helptag.html?tag=ftplugin) (for buffers
331
+
matching `<filetypes>`). Intended to be used for loading "language plugins".
332
+
333
+
<spanclass="help-syntax-special">{f}</span> `(function)` Function to execute (without arguments).
334
+
335
+
#### Usage {#minimisc.safely-usage}
336
+
337
+
338
+
339
+
```lua
340
+
MiniMisc.safely('later', function()
341
+
vim.notify('This will be executed after the next "now" call')
342
+
end)
343
+
MiniMisc.safely('now', function() error('This will be a warning') end)
Copy file name to clipboardExpand all lines: mini.nvim/readmes/mini-misc.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,7 @@ If you want to help this project grow but don't know where to start, check out [
38
38
-`log_add()` / `log_show()` and other helper functions to work with a special in-memory log array. Useful when debugging Lua code (instead of `print()`).
39
39
-`put()` and `put_text()` print Lua objects in command line and current buffer respectively.
40
40
-`resize_window()` resizes current window to its editable width.
41
+
-`safely()` to execute a function on a condition and warn on error. Useful to organize 'init.lua' in fail-safe sections with simple lazy loading.
41
42
-`setup_auto_root()` sets up automated change of current directory.
42
43
-`setup_termbg_sync()` to set up terminal background synchronization (removes possible "frame" around current Neovim instance).
43
44
-`setup_restore_cursor()` sets up automated restoration of cursor position on file reopen.
0 commit comments