Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash When Moving Two Filtered Snippets #19

Open
cwarden opened this issue Dec 9, 2022 · 2 comments
Open

Crash When Moving Two Filtered Snippets #19

cwarden opened this issue Dec 9, 2022 · 2 comments

Comments

@cwarden
Copy link
Contributor

cwarden commented Dec 9, 2022

Describe the bug
nap segfaults when moving two snippets from filtered list

To Reproduce
Steps to reproduce the behavior:

  1. Create some snippets
$ export NAP_HOME=$(mktemp -d)
$ jot 100 0 | parallel -P1 'echo note {} | nap {}.txt'
  1. Start nap TUI
  2. Filter snippets. Type /0<Enter>
  3. Move first snippet. Type Rx<Enter>
  4. Return to misc folder. Type <Shift>+<Tab>k<Enter>
  5. Move first snippet. Type Rx<Enter>

Panic:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x542df5]

goroutine 170 [running]:
github.com/charmbracelet/bubbles/list.filterItems.func1()
        /home/cwarden/go/pkg/mod/github.com/charmbracelet/bubbles@v0.14.1-0.20221107150503-fac7a01329ea/list/list.go:1197 +0x415
github.com/charmbracelet/bubbletea.(*Program).handleCommands.func1.1()
        /home/cwarden/go/pkg/mod/github.com/charmbracelet/bubbletea@v0.23.0/tea.go:247 +0x38
created by github.com/charmbracelet/bubbletea.(*Program).handleCommands.func1
        /home/cwarden/go/pkg/mod/github.com/charmbracelet/bubbletea@v0.23.0/tea.go:246 +0x14d

Expected behavior
After moving the snippet from the misc folder to the miscx folder in step 4, it should only appear once in the list of filtered snippets.

Screenshots
This snippet should no longer exist.

2022-12-09-122713_1186x709_scrot

Desktop (please complete the following information):

@maaslalani
Copy link
Owner

Thanks for reporting this! I will try to fix this soon!

@vaygr
Copy link

vaygr commented Sep 1, 2023

This is happening even when the number of filtered items is the same as unfiltered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants