This needs a different approach, likely on the level of custom editors itself. Given custom editors are to implement backups, moving between windows should actually not result in data loss in most cases.
For custom editors that ignore backups, a better approach would be to throw an error or force to save right before a `webview` is about to get disposed because it moved to another window.
Tab size and indent size were separated in #155450, but for deciding
where to put "//" or "#" when toggling a line comment tab size was still
used.
Fixes#170393.
Co-authored-by: Alexandru Dima <alexdima@microsoft.com>
* Do not trim whitespace when part of strings or regexes
Fixes https://github.com/microsoft/vscode/issues/195010. If the token to be removed is part of a string or a regex, then we do not want to remove the character, as it is very likely semantically important.
* Address initial feedback:
1. Add a new setting to control whether to trim whitespace in multiline strings/regexes. This setting is then piped through to everywhere that is calling trim whitespace, which is file save editing, the trim whitespace command, and notebooks.
2. Force line tokenization to complete when the setting is enabled so that trim is accurate.
* Don't force tokenization; instead, check to see if there are tokens for a given line and do not format if there are none.
* Look for syntactical tokens
* Fix compilation errors
* Add a test
---------
Co-authored-by: Alex Dima <alexdima@microsoft.com>
* Invalidate and update extensionPaths on load
* Also update the `ExtensionPaths` search tree after startup because it applies an extension delta
* Cache realpath calls
---------
Co-authored-by: Alexandru Dima <alexdima@microsoft.com>
* Sort lines: sort all lines if nothing selected.
Previously, 'sort lines' did nothing if nothing was selected.
Likewise 'delete duplicate lines' should apply to all lines if nothing is selected.
* 💄
---------
Co-authored-by: Matthew Hickford <matthew.hickford@cloud.com>
Co-authored-by: Alexandru Dima <alexdima@microsoft.com>
* Add support for recognizing word locales in word operations (#50045)
* Move intlSegmenterLocales in the WordCharacterClassifier class
* Rerun compiler
* Renames
* Avoid duplicating code
---------
Co-authored-by: Alex Dima <alexdima@microsoft.com>