commit 09ffb581cb24201303d191a7c7e4b28016658a7c (tree) parent 2e1ed889fffce540906bc3c97135669e56a4dff8 Author: LemonBoy <thatlemon@gmail.com> Date: Sat, 20 Feb 2021 18:44:21 +0100 Recompute folds on update Diffstat:
| M | autoload/zig/fmt.vim | | | 11 | ++++++++--- |
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/autoload/zig/fmt.vim b/autoload/zig/fmt.vim @@ -48,13 +48,18 @@ function! zig#fmt#Format() abort execute 'lwindow ' . win_height endif + call delete(stderr_file) + + call winrestview(view) + if err != 0 echohl Error | echomsg "zig fmt returned error" | echohl None + return endif - call delete(stderr_file) - - call winrestview(view) + " Run the syntax highlighter on the updated content and recompute the folds if + " needed. + syntax sync fromstart endfunction " parse_errors parses the given errors and returns a list of parsed errors