-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Option to insert comment character(s) at the beginning of the line(s) (…
…#19746) Closes #19459 This PR adds the optional setting to insert comment character(s) at the beginning of the line(s) instead of after the indentation. It can be enabled via keybindings: ``` "ctrl-/": ["editor::ToggleComments", { "ignore_indent": true }] ``` As suggested by @notpeter in #19459, this is implemented in `toggle_comments` (editor.rs) taking the existing `advance_downwards` option as example. There's also a test case for the setting, which mimics the test case for the regular comment toggling behavior. --- I am not entirely happy with the name `ignore_indent`. The default would be a double negative now `ignore_indent=false`. A positive wording would probably easier to understand, but I could not think of anything concise. `insert_at_line_start` or just `at_line_start` might work, but didn't convince me either. That said, I am happy to change the name if there are better ideas. --- Release Notes: - Added optional setting to insert comment character(s) at the beginning of the line(s) instead of after the indentation. It can be used by changing the default mapping to toggle comments like this: `"ctrl-/": ["editor::ToggleComments", { "ignore_indent": true }]`
- Loading branch information
Showing
3 changed files
with
149 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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