Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Commit 84ad9a1

Browse files
authored
Merge pull request #250 from wingrunr21/fix_highlighting
Fix getEntry regex to handle additional cases
2 parents d8a2538 + 2331128 commit 84ad9a1

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎src/ruby.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ function registerHighlightProvider(ctx: ExtensionContext) {
5252
}
5353

5454
const getEntry = function(line) {
55-
//only lines that start with the entry
56-
let match = line.text.match(/^(\s*)(begin|class|def|for|if|module|unless|until|case|while)\b[^\{;]*$/);
55+
let match = line.text.match(/^(.*\b)(begin|class|def|for|if|module|unless|until|case|while)\b[^;]*$/);
5756
if (match) {
5857
return new vscode.Range(line.lineNumber, match[1].length, line.lineNumber, match[1].length + match[2].length);
5958
} else {

0 commit comments

Comments
 (0)