Skip to content

Commit

Permalink
[JavaScript] Fix block comment punctuation
Browse files Browse the repository at this point in the history
This commit adds scoping for leading asterisks in (normal) block comments
so ST's word_wrap command can add them to each wrapped line, if present in
the first one.

Notes:

This change aligns JavaScript with Java and C/C++.

Related with #3855
  • Loading branch information
deathaxe committed Oct 20, 2023
1 parent 3125fdd commit 0de15ed
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions JavaScript/JavaScript.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ contexts:
- meta_include_prototype: false
- meta_scope: comment.block.js
- include: block-comment-end
- match: ^\s*(\*)(?!/)
captures:
1: punctuation.definition.comment.js

jsdoc-comment-body:
- meta_include_prototype: false
Expand Down
6 changes: 6 additions & 0 deletions JavaScript/tests/syntax_test_js.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
//^^^ comment.block.js
// ^ - comment

/*
* comment
// ^ comment.block.js punctuation.definition.comment.js
// ^^^^^^^^^ comment.block.js - punctuation
*/

/**/ /***/
// ^ - comment
// ^^^^ comment.block.empty.js punctuation.definition.comment.js
Expand Down

0 comments on commit 0de15ed

Please sign in to comment.