File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -288,7 +288,6 @@ define([
288288 } ) ;
289289 }
290290 }
291-
292291 } ) ;
293292 }
294293
Original file line number Diff line number Diff line change @@ -235,6 +235,18 @@ define([
235235 that . reloadInsEditor ( ) ;
236236 } ) ;
237237
238+ // backspace
239+ $ ( document ) . on ( 'keyup' , this . wrapSelector ( '.CodeMirror' ) , function ( event ) {
240+ var keycode = event . keyCode
241+ ? event . keyCode
242+ : event . which ;
243+ if ( keycode == 8 ) {
244+ // backspace
245+ that . popStack ( ) ;
246+ that . reloadInsEditor ( ) ;
247+ }
248+ } ) ;
249+
238250 // subset button clicked
239251 $ ( document ) . on ( 'click' , this . wrapSelector ( '.vp-ds-button' ) , function ( event ) {
240252 var insEditorType = $ ( this ) . closest ( '.vp-instance-box' ) . hasClass ( 'variable' ) ? 'variable' : 'allocate' ;
@@ -369,11 +381,10 @@ define([
369381 }
370382
371383 VariablePackage . prototype . popStack = function ( replace = true ) {
372- if ( this . pointer . stack . length <= 0 ) {
373- return '' ;
374- }
375-
376384 var lastValue = this . pointer . stack . pop ( ) ;
385+ if ( ! lastValue ) {
386+ lastValue = '' ;
387+ }
377388 if ( replace ) {
378389 this . updateValue ( '' , lastValue ) ;
379390 }
You can’t perform that action at this time.
0 commit comments