forked from Julian/lean.nvim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It turns out that most of these come from the `_DEFAULTS` pattern. This is because of the following: original state: ```lua tbl = { _DEFAULTS = ... } ``` after configuration with empty table, `tbl = vim.tbl_extend(tbl._DEFAULTS, {})` which practically replaces `tbl` by `tbl._DEFAULTS`: ```lua tbl = { ... } ``` after this, the next call to `vim.tbl_extend(tbl._DEFAULTS, {})` fails, as `tbl._DEFAULTS` is nil. The solution to this is to just call `vim.tbl_extend(tbl, ...)` and store the defaults in `tbl` itself. The `._DEFAULTS` field can be preserved by copying to it after initialization. Also `command` has been replaced with `command!` in vimscript and `autocmd`s have been wrapped in an `augroup` which resets its state each call. This is also common practice that avoids duplicate autocommands. Fixes Julian#145
- Loading branch information
Showing
5 changed files
with
42 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters