diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2025-02-05 23:09:29 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2025-02-05 23:09:29 +0000 |
commit | d5f194ce780c95821a855aca3c19426576d28ae0 (patch) | |
tree | d45f461b19f9118ad2bb1f440a7a08973ad18832 /src/nvim/textformat.c | |
parent | c5d770d311841ea5230426cc4c868e8db27300a8 (diff) | |
parent | 44740e561fc93afe3ebecfd3618bda2d2abeafb0 (diff) | |
download | rneovim-rahm.tar.gz rneovim-rahm.tar.bz2 rneovim-rahm.zip |
Diffstat (limited to 'src/nvim/textformat.c')
-rw-r--r-- | src/nvim/textformat.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nvim/textformat.c b/src/nvim/textformat.c index 06b3aa0411..ca2829fecb 100644 --- a/src/nvim/textformat.c +++ b/src/nvim/textformat.c @@ -18,6 +18,7 @@ #include "nvim/globals.h" #include "nvim/indent.h" #include "nvim/indent_c.h" +#include "nvim/macros_defs.h" #include "nvim/mark.h" #include "nvim/mbyte.h" #include "nvim/memline.h" @@ -35,6 +36,7 @@ #include "nvim/strings.h" #include "nvim/textformat.h" #include "nvim/textobject.h" +#include "nvim/ui.h" #include "nvim/undo.h" #include "nvim/vim_defs.h" #include "nvim/window.h" @@ -1049,12 +1051,18 @@ void format_lines(linenr_T line_count, bool avoid_fex) State = MODE_INSERT; // for open_line() smd_save = p_smd; p_smd = false; + insertchar(NUL, INSCHAR_FORMAT + (do_comments ? INSCHAR_DO_COM : 0) + (do_comments && do_comments_list ? INSCHAR_COM_LIST : 0) + (avoid_fex ? INSCHAR_NO_FEX : 0), second_indent); + State = old_State; p_smd = smd_save; + // Cursor shape may have been updated (e.g. by :normal) in insertchar(), + // so it needs to be updated here. + ui_cursor_shape(); + second_indent = -1; // at end of par.: need to set indent of next par. need_set_indent = is_end_par; |