ajaxorg / ace

Ace (Ajax.org Cloud9 Editor)

Home Page:https://ace.c9.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

$undoManager.toJSON() should not include action "removeFolds"

alexsch01 opened this issue · comments

Describe the bug

JSON.stringify(editor.session.$undoManager.toJSON()) will lead to a "Converting circular structure to JSON" error in certain circumstances

Expected Behavior

It should never lead to the "Converting circular structure to JSON" error

Reproduction Steps

{
    
}
  • Click on the fold code button
  • Press CTRL+A
  • Press Backspace
  • Click on the TEST button

An alert with the following message gets shown [trying to do JSON.stringify(editor.session.$undoManager.toJSON())]

TypeError: Converting circular structure to JSON
    --> starting at object with constructor 't'
    |     property 'foldLine' -> object with constructor 'e'
    |     property 'folds' -> object with constructor 'Array'
    --- index 0 closes the circle

Additional Information/Context

output of editor.session.$undoManager.toJSON()


image

Ace Version / Browser / OS / Keyboard layout

v1.32.7 on Google Chrome