glorious-demo icon indicating copy to clipboard operation
glorious-demo copied to clipboard

Allow users to edit the existing typed code in the editor

Open rafaelcamargo opened this issue 4 years ago • 1 comments

According this comment, figure out a way of offering a way to edit some already typed code.

Users should be allowed to:

  • [ ] Add an entire new line in the middle of the existing code
  • [ ] Add a new char in the middle of some existing line
  • [ ] Remove an entire line
  • [ ] Remove a char from a specific line

rafaelcamargo avatar Jul 10 '19 12:07 rafaelcamargo

It could look like this:

demo  
  .openApp('editor', {minHeight: '350px', windowTitle: 'demo.js'}) 
  .write(codeSegment0) //initial code 
  .write(codeSegment1, {insertAt:{line:2}}) // insert at start of line 2, default char 0
  .write(codeSegment2, {insertAt:{line:6, char:5}}) // insert after line 6, char 5
  .replace('', {from:{line:2}, to: {line:4}) // remove lines 2 through 4
  .replace(codeSegment3, {from:{line:8, char: 3}, to: {line:8, char: 10})
  .end()

quinton-ashley avatar Jul 10 '19 18:07 quinton-ashley