Skip to content

Commit

Permalink
Fixes #302
Browse files Browse the repository at this point in the history
  • Loading branch information
antonmedv committed Mar 28, 2024
1 parent bf8fe0a commit fe1216f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/jsonx/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ func (n *Node) Parent() *Node {
return parent
}

func (n *Node) IsWrap() bool {
return n.Value == nil && n.Chunk != nil
}

func (n *Node) IsCollapsed() bool {
return n.Collapsed != nil
}
Expand Down
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,9 @@ func (m *model) cursorKey() string {
if at == nil {
return ""
}
if at.IsWrap() {
at = at.Parent()
}
if at.Key != nil {
var v string
_ = json.Unmarshal(at.Key, &v)
Expand Down

0 comments on commit fe1216f

Please sign in to comment.