diff options
author | Grolaf <75337003+Grolaf@users.noreply.github.com> | 2024-07-16 06:07:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-15 21:07:55 -0700 |
commit | 1d1362b0261d06a0b91872e916c172320bbb988a (patch) | |
tree | 599c2cfe050dafb4e824fc83ab505613c0c80517 /README.md | |
parent | cc1ba956b61543641ddeeb7694c7cdaa33cd157c (diff) |
feat: add undojoin as a format option (#488)
* feat: add new format option: undojoin
This option allow user to automatically perform undojoin command before
formatting. This is useful if the user uses an autosave plugin + format
on save, because in case of undo, it will undo the last change AND the
formatting. Without this option, it will only undo the formatting.
* fix: passed linting
* fix: apply undojoin for LSP formatting
* doc: fix type annotations for apply_format
* doc: regenerate documentation
---------
Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -593,6 +593,7 @@ Format a buffer | | bufnr | `nil\|integer` | Format this buffer (default 0) | | | async | `nil\|boolean` | If true the method won't block. Defaults to false. If the buffer is modified before the formatter completes, the formatting will be discarded. | | | dry_run | `nil\|boolean` | If true don't apply formatting changes to the buffer | +| | undojoin | `nil\|boolean` | Use undojoin to merge formatting changes with previous edit (default false) | | | formatters | `nil\|string[]` | List of formatters to run. Defaults to all formatters for the buffer filetype. | | | lsp_format | `nil\|conform.LspFormatOpts` | Configure if and when LSP should be used for formatting. Defaults to "never". | | | | > `"never"` | never use the LSP for formatting (default) | |