editor: Add comment_on_empty_lines setting for multi-line comment toggle#60785
Open
NsdHSO wants to merge 3 commits into
Open
editor: Add comment_on_empty_lines setting for multi-line comment toggle#60785NsdHSO wants to merge 3 commits into
NsdHSO wants to merge 3 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This addresses #60738 — when toggling comments on a multi-line selection, empty lines are skipped instead of getting comment markers.
Adds a new setting
comment_on_empty_lines(default:false). When enabled, blank lines within the selection also receive//at the minimum indentation column, matching VS Code behavior.
Changes:
ToggleCommentOnEmptyLinesaction + toggle handler inconfig.rscomment_on_empty_linesfield inEditorSettingstoggle_comments()— inserts comment prefixes with proper indentation alignment, handles empty lines (padded) and whitespace-only linesdefault.jsonVideo for better
https://github.com/user-attachments/assets/cb4f2ac9-a728-4b54-8517-9d08b898a92e
https://github.com/user-attachments/assets/68f6f179-85bd-4df2-99a0-bd086fe5b038
Release Notes:
comment_on_empty_linessetting to include blank lines when toggling comments in multi-line selections