From 12229a17190bce85b6b63c47dff8000e0ef8e39f Mon Sep 17 00:00:00 2001 From: amedora Date: Thu, 9 May 2019 10:55:31 +0900 Subject: [PATCH] allow to expand snippets following $ character --- browser/components/CodeEditor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/browser/components/CodeEditor.js b/browser/components/CodeEditor.js index 2f2b1551..4893b342 100644 --- a/browser/components/CodeEditor.js +++ b/browser/components/CodeEditor.js @@ -202,7 +202,7 @@ export default class CodeEditor extends React.Component { } cm.execCommand('goLineEnd') } else if ( - !charBeforeCursor.match(/\t|\s|\r|\n/) && + !charBeforeCursor.match(/\t|\s|\r|\n|\$/) && cursor.ch > 1 ) { // text expansion on tab key if the char before is alphabet @@ -489,7 +489,7 @@ export default class CodeEditor extends React.Component { getWordBeforeCursor (line, lineNumber, cursorPosition) { let wordBeforeCursor = '' const originCursorPosition = cursorPosition - const emptyChars = /\t|\s|\r|\n/ + const emptyChars = /\t|\s|\r|\n|\$/ // to prevent the word is long that will crash the whole app // the safeStop is there to stop user to expand words that longer than 20 chars