NetLogo / NetLogo

turtles, patches, and links for kids, teachers, and scientists
http://ccl.northwestern.edu/netlogo/
1.01k stars 243 forks source link

6.0.1-M1: Re-indenting adds the deletion of the current line to the undo history. #1329

Closed qiemem closed 7 years ago

qiemem commented 7 years ago

To reproduce:

Open a model. Put the cursor in any line. Press "tab", "enter", or "]". Press the undo hotkey. The line will be deleted. Press the undo hotkey again to restore it.

mrerrormessage commented 7 years ago

The changes to the indenter delete the text and add in new text to replace it. This allows re-indentation to be done in a single operation. This operation should be packaged in such a way that Swing understands it as an atomic edit, even though it performs both a deletion and an insertion.