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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: prevent duplicate buffer name error with setNames #186

Merged
merged 2 commits into from
Feb 14, 2023

Conversation

shortcuts
Copy link
Owner

馃搩 Summary

With setNames=true, toggling the plugin at least twice result in the following error:

FAIL in tests/test_buffers.lua | left/right | setNames doesn't throw when re-creating side buffers: Vim:Error executing Lua cal
lback: ...lm/Documents/no-neck-pain.nvim/lua/no-neck-pain/wins.lua:76: Vim:E95: Buffer with this name already exists
  stack traceback:
        [C]: in function 'nvim_buf_set_name'
        ...lm/Documents/no-neck-pain.nvim/lua/no-neck-pain/wins.lua:76: in function 'createSideBuffers'
        ...lm/Documents/no-neck-pain.nvim/lua/no-neck-pain/main.lua:44: in function 'init'
        ...lm/Documents/no-neck-pain.nvim/lua/no-neck-pain/main.lua:77: in function 'toggle'
        ...lm/Documents/no-neck-pain.nvim/lua/no-neck-pain/init.lua:11: in function 'toggle'
        .../klm/Documents/no-neck-pain.nvim/plugin/no-neck-pain.lua:18: in function <.../klm/Documents/no-neck-pain.nvim/plugin
/no-neck-pain.lua:17>
  Traceback:
    tests/test_buffers.lua:242

make: *** [test] Error 1

This PR solves this issue by deleting the buffer if it exist.

@shortcuts shortcuts self-assigned this Feb 14, 2023
@shortcuts shortcuts merged commit 27b3167 into main Feb 14, 2023
@shortcuts shortcuts deleted the fix/setName-duplicate-buffers branch February 14, 2023 22:44
shortcuts pushed a commit that referenced this pull request Feb 15, 2023
馃 I have created a release *beep* *boop*
---


##
[0.9.2](v0.9.1...v0.9.2)
(2023-02-15)


### Bug Fixes

* prevent duplicate buffer name error with `setNames`
([#186](#186))
([27b3167](27b3167))
* textColor blending
([#188](#188))
([c2b8467](c2b8467))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

None yet

1 participant