Skip to content

Commit

Permalink
fix: pasted or replaced contents not being expanded
Browse files Browse the repository at this point in the history
  • Loading branch information
josdejong committed Apr 4, 2022
1 parent d9eb233 commit 4e86440
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/components/modes/treemode/TreeMode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@
const previousSelection = selection
json = updatedJson
state = syncState(json, previousState, [], defaultExpand)
state = syncState(json, previousState, [], defaultExpand, true)
text = undefined
textIsRepaired = false
selection = clearSelectionWhenNotExisting(selection, json)
Expand Down Expand Up @@ -407,14 +407,14 @@
try {
json = JSON.parse(updatedText)
state = syncState(json, previousState, [], defaultExpand)
state = syncState(json, previousState, [], defaultExpand, true)
text = updatedText
textIsRepaired = false
selection = clearSelectionWhenNotExisting(selection, json)
} catch (err) {
try {
json = JSON.parse(jsonrepair(updatedText))
state = syncState(json, previousState, [], defaultExpand)
state = syncState(json, previousState, [], defaultExpand, true)
text = updatedText
textIsRepaired = true
selection = clearSelectionWhenNotExisting(selection, json)
Expand Down

0 comments on commit 4e86440

Please sign in to comment.