Skip to content

Implement saveAfterFormat option - #31

Open
alastairsounds wants to merge 1 commit into
jota0222:mainfrom
alastairsounds:fix/autosave
Open

alastairsounds wants to merge 1 commit into
jota0222:mainfrom
alastairsounds:fix/autosave

Conversation

@alastairsounds

Copy link
Copy Markdown

Adds multiFormatter.saveAfterFormat setting to control whether manual format commands save the file. Fixes #30.

Default true preserves today's behavior exactly. Existing users see no change. Setting the value to false formats the document without saving. Ctrl+S with editor.formatOnSave still saves.

Changes

  • New multiFormatter.saveAfterFormat setting in package.json (boolean, default true, language-overridable scope)
  • New workspace.onWillSaveTextDocument listener in src/formatter.ts to detect format-on-save
  • Replaced static editor.formatOnSave check with real signal about the current invocation

Behavior

Trigger saveAfterFormat: true saveAfterFormat: false
MultiFormat Document saves does not save
Format Document (⇧⌥F) saves does not save
Ctrl+S with editor.formatOnSave saves saves

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MultiFormat Document shouldn't always save the file

1 participant