You likely want this:
let word = context.matchBefore(/[\w-]*/);
This will match from the cursor backwards to zero or more letters, numbers, underscores, and dashes.
You likely want this:
let word = context.matchBefore(/[\w-]*/);
This will match from the cursor backwards to zero or more letters, numbers, underscores, and dashes.
Thank you @sukima , your regex works very well
Iām thinking about making it the default
Thanks!
Simon