Skip to content

Commit c55e0be

Browse files
committed
When commenting, use the language after the line start, not before
FIX: Fix an issue where creating a comment for a line that starts an inner language would use the comment style from the outer language. Closes codemirror/dev#1544
1 parent d6b6d01 commit c55e0be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/comment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export const toggleBlockCommentByLine =
6161
command((o, s) => changeBlockComment(o, s, selectedLineRanges(s)), CommentOption.Toggle)
6262

6363
function getConfig(state: EditorState, pos: number) {
64-
let data = state.languageDataAt<CommentTokens>("commentTokens", pos)
64+
let data = state.languageDataAt<CommentTokens>("commentTokens", pos, 1)
6565
return data.length ? data[0] : {}
6666
}
6767

0 commit comments

Comments
 (0)