Bug - Saving Snippet to Bundle that's not default.txt will often not save correctly.
~~Causes #284 (I think?)~~ Unrelated; non-issue While adding a snippet and picking a bundle, I'll often see that the wrong bundle has been selected (usually default.txt).
I can make it show the correct bundle if I perform a search that narrows the results to only the bundle I want and then adding a snippet.
Another issue will then occur once I save the snippet. The snippet will be added to default.txt anyways, but not the normal default.txt; it's only added to the default.txt in the backup folder (which will eventually get overwritten when backups next happen).
I'm not really sure of the cause. ~~Maybe since I have AlwaysUpdateBundles enabled? I haven't really tested that theory because I'm constantly creating and tweaking snippets and sometimes I have to hard kill Lintalist when it freezes and don't want to lose my work.~~ That wasn't the cause.
Video:
https://github.com/lintalist/lintalist/assets/9045213/3d5faed9-12e3-4b20-b6a3-0fb56d610140
Originally posted by @TFWol in https://github.com/lintalist/lintalist/discussions/284#discussioncomment-9824279
Once in a blue moon I have noticed this myself too, restarting lintalist solves it. I can not replicate it consistently or at all. It happens or it doesn't. It somehow 'looses' the correct bundle somewhere in the editor but I set that everywhere I think it should and even double check there is bundle to append to https://github.com/lintalist/lintalist/blob/f847d600d0e96c3430497a1ef9b65852784d3481/include/Editor.ahk#L649
The AppendToBundle variable at various locations in Editor.ahk is used to set the filename.txt of the bundle so it can use FileName_BUNDLEINDEX created here https://github.com/lintalist/lintalist/blob/f847d600d0e96c3430497a1ef9b65852784d3481/include/ObjectBundles.ahk#L240
So AppendToBundle seems to be set to an incorrect value or it falls back to default.
Cool, at least it's not just me.
I'll try running Lintalist in debug mode occasionally to see if I can find a reliable way to trigger it.
### Reminders
- [ ] Keep running Lintalist in debugger
I still haven't figured it out. Admittedly, I've gotten a little sidetracked 😆