Add comment on next line when not at the end of the line comment in onEnter rules (#233219)

adding line comment when not at the end of a line
This commit is contained in:
Aiday Marlen Kyzy
2024-11-06 17:45:54 +01:00
committed by GitHub
parent af4c2d2666
commit e8e5333cbb
2 changed files with 14 additions and 1 deletions

View File

@@ -228,5 +228,18 @@
"appendText": "\t", "appendText": "\t",
} }
}, },
// Add // when pressing enter from inside line comment
{
"beforeText": {
"pattern": "\/\/.*"
},
"afterText": {
"pattern": "^(?!\\s*$).+"
},
"action": {
"indent": "none",
"appendText": "// "
}
},
] ]
} }

View File

@@ -252,7 +252,7 @@
"pattern": "\/\/.*" "pattern": "\/\/.*"
}, },
"afterText": { "afterText": {
"pattern": ".*" "pattern": "^(?!\\s*$).+"
}, },
"action": { "action": {
"indent": "none", "indent": "none",