Skip to content

Conversation

@jeremypw
Copy link
Collaborator

@jeremypw jeremypw commented Nov 9, 2025

Fixes #581

It is considered potentially problematic to strip spaces on autosave so this solution is proposed. Stripping only occurs when the document is unfocused on the assumption that in that case the user is no in mid edit.

It is inconvenient to have to both move and click the pointer to focus the terminal and the same to refocus the document. Also lint errors are often caused by failing to force save the document first (trailing spaces are not stripped during autosave).

  • Implement focus follow between the terminal and the current document (does this need a setting?)
  • Strip trailing spaces from the document when focused out (subject to the setting). Leave whether this change is saved to the AutoSave setting,

@jeremypw jeremypw marked this pull request as ready for review November 9, 2025 12:07
@jeremypw jeremypw added this to the 8.3 milestone Nov 9, 2025
@jeremypw jeremypw requested a review from a team November 10, 2025 16:53
Copy link
Member

@ryonakano ryonakano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if we should reuse strip-trailing-on-save setting because this is not triggered on save.

@jeremypw
Copy link
Collaborator Author

jeremypw commented Dec 27, 2025

@ryonakano Maybe we can rename the setting to strip-trailing-on-save-or-focus-out or just strip-trailing-spaces? This setting is intended to control whether trailing spaces are ever stripped; the fact that up to now this only occurred on saving (non-auto) is kind of incidental. I cannot see the advantage of having two separate settings tbh.

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.

Automatically remove trailing spaces after pressing Enter when autosave is enabled

3 participants