File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -536,9 +536,11 @@ export class TextAreaAutoComplete {
536536 #update( ) {
537537 let before = this . helper . getBeforeCursor ( ) ;
538538 if ( before ?. length ) {
539- const m = before . match ( / ( [ ^ \s | , | ; | " ] + ) $ / ) ;
539+ const m = before . match ( / ( [ ^ , ; " | { } ( ) \n ] + ) $ / ) ;
540540 if ( m ) {
541- before = m [ 0 ] ;
541+ before = m [ 0 ]
542+ . replace ( / ^ \s + / , "" )
543+ . replace ( / \s / g, "_" ) || null ;
542544 } else {
543545 before = null ;
544546 }
@@ -619,6 +621,10 @@ export class TextAreaAutoComplete {
619621 value = TextAreaAutoComplete . replacer ( value ) ;
620622 }
621623 value = this . #escapeParentheses( value ) ;
624+
625+ // Remove underscore
626+ value = value . replace ( / _ / g, " " ) ;
627+
622628 const afterCursor = this . helper . getAfterCursor ( ) ;
623629 const shouldAddSeparator = ! afterCursor . trim ( ) . startsWith ( this . separator . trim ( ) ) ;
624630 this . helper . insertAtCursor (
You can’t perform that action at this time.
0 commit comments