fix dig-path ctrl+w (#275)

This commit is contained in:
Mateus Esdras 2023-09-25 02:21:46 -03:00 committed by GitHub
parent 7abb4de3d3
commit 8caeacff62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -253,7 +253,9 @@ func (m *model) handleDigKey(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
case key.Matches(msg, key.NewBinding(key.WithKeys("ctrl+w"))):
digPath, ok := jsonpath.Split(m.digInput.Value())
if ok {
digPath = digPath[:len(digPath)-1]
if len(digPath) > 0 {
digPath = digPath[:len(digPath)-1]
}
n := m.selectByPath(digPath)
if n != nil {
m.selectNode(n)