-
Notifications
You must be signed in to change notification settings - Fork 41.1k
Automatically set detached state as needed. #925
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
Conversation
|
Updated as requested, works on my machine :) |
lua/kickstart/plugins/debug.lua
Outdated
| delve = { | ||
| -- On Windows delve must be run attached or it crashes. | ||
| -- See https://github.com/leoluz/nvim-dap-go/blob/main/README.md#configuring | ||
| detached = not vim.fn.has 'win32', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I think this will always be false
vim.fn.has will return 0 or 1, and in lua not 0 and not 1 will both be false
so I think this needs to be:
detached = vim.fn.has 'win32' == 0,
can you please test that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, Lua does that funny thing with numbers and boolean ops. My bad, will fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hi,
Here's a fix to automatically set the detached state for delve based on the OS. Gives a better first-time experience when delve doesn't crash :)