Skip to content

Commit

Permalink
fix: expand contents when pasting in an empty document
Browse files Browse the repository at this point in the history
  • Loading branch information
josdejong committed Jan 8, 2022
1 parent a1f8458 commit a3c8021
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/components/modes/treemode/TreeMode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,8 @@
debug('paste', { clipboardText })
handleChangeText(clipboardText)
handleExpand([], true, false)
}
}
Expand Down Expand Up @@ -1403,7 +1405,7 @@
} catch (err) {
// no valid JSON, will show empty document or invalid json
json = undefined
state = createState(json)
state = syncState(json, createState(json), [], defaultExpand)
text = updatedText
textIsRepaired = false
selection = clearSelectionWhenNotExisting(selection, json)
Expand Down

0 comments on commit a3c8021

Please sign in to comment.