Skip to content

Commit 12229a1

Browse files
amedoraRokt33r
authored andcommitted
allow to expand snippets following $ character
1 parent 3779016 commit 12229a1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

browser/components/CodeEditor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export default class CodeEditor extends React.Component {
202202
}
203203
cm.execCommand('goLineEnd')
204204
} else if (
205-
!charBeforeCursor.match(/\t|\s|\r|\n/) &&
205+
!charBeforeCursor.match(/\t|\s|\r|\n|\$/) &&
206206
cursor.ch > 1
207207
) {
208208
// text expansion on tab key if the char before is alphabet
@@ -489,7 +489,7 @@ export default class CodeEditor extends React.Component {
489489
getWordBeforeCursor (line, lineNumber, cursorPosition) {
490490
let wordBeforeCursor = ''
491491
const originCursorPosition = cursorPosition
492-
const emptyChars = /\t|\s|\r|\n/
492+
const emptyChars = /\t|\s|\r|\n|\$/
493493

494494
// to prevent the word is long that will crash the whole app
495495
// the safeStop is there to stop user to expand words that longer than 20 chars

0 commit comments

Comments
 (0)