diff --git a/HISTORY.md b/HISTORY.md index 0fcaa20..bda4e16 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -9,6 +9,8 @@ https://github.com/josdejong/jsoneditor Transform modal. New options `createQuery`, `executeQuery`, and `queryDescription` are available for this now. An example is available in `examples/23_custom_query_language.html`. See #857, #871. +- Fix history (undo/redo) being cleared in mode `code` and `text` after + transforming or sorting. ## 2020-01-25, version 8.4.1 diff --git a/src/js/textmode.js b/src/js/textmode.js index 0d9a300..0cc2117 100644 --- a/src/js/textmode.js +++ b/src/js/textmode.js @@ -408,14 +408,14 @@ textmode._showSortModal = function () { const sortedJson = sort(json, sortedBy.path, sortedBy.direction) me.sortedBy = sortedBy - me.set(sortedJson) + me.update(sortedJson) } if (isObject(json)) { const sortedJson = sortObjectKeys(json, sortedBy.direction) me.sortedBy = sortedBy - me.set(sortedJson) + me.update(sortedJson) } } @@ -438,7 +438,7 @@ textmode._showTransformModal = function () { executeQuery, onTransform: query => { const updatedJson = executeQuery(json, query) - this.set(updatedJson) + this.update(updatedJson) } }) }