-
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: save_extra_cmds only works with single string
`Lib.run_hook_cmds` returns a table of tables (one for reach hook cmd that was run). In `save_extra_cmds`, `vim.fn.writefile` expects a table strings and if any of those strings contain newlines, they're translated into nul characters. That means that there was no way to return more than one line from a `save_extra_cmds` hook function. To fix, we combine the results across all `save_extra_cmds` hooks and we now support a `save_extra_cmds` hook returning either a string (possibly with newlines) or table. If a hook returns a string then any newlines will be used to split the string into individual line entries in the table passed to `vim.fn.writefile`. If a hook returns a table, then each of the values of the table will be added to the table passed to `vim.fn.writefile` (the same newline splitting will also happen)
- Loading branch information
Showing
5 changed files
with
162 additions
and
7 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