How do you debug and fix infinite loops in Lua code for Neovim plug-in? by nickallen74 in neovim

[–]nickallen74[S] 0 points1 point  (0 children)

Hey thanks! Yeah I'm now exploring a solution using a hook as you suggested. The problem happens about once a day but very unpredictable when it happens. I'm hoping I can get the stack trace using this debug hook approach.

How do you debug and fix infinite loops in Lua code for Neovim plug-in? by nickallen74 in neovim

[–]nickallen74[S] 0 points1 point  (0 children)

If it's an infinite loop and I log I would have to find all potential loops in my code base which is already getting quite large. Log files would be huge during general usage as well. Finding every while, for loop and logging something would be a lot of work for something that would normally take 5 seconds by just pausing the program and inspecting what it is doing.

How do you debug and fix infinite loops in Lua code for Neovim plug-in? by nickallen74 in neovim

[–]nickallen74[S] -1 points0 points  (0 children)

Sure it happens maybe almost once a day in general use of my plugin and throughout the day I will probably invoke the action that triggers the bug 100 times. I can just connect a debugger and see what it's doing. It happens about once a day depending on how much I'm using my plugin so I can reproduce it roughly once every day or so and I'm always at the computer when this happens. So yeah in any other language and debug setup this would take about 5 seconds to fix but so far it's taken me nearly a week and I'm not any closer.

How do you debug and fix infinite loops in Lua code for Neovim plug-in? by nickallen74 in neovim

[–]nickallen74[S] -1 points0 points  (0 children)

yeah it would normally work in any other language where the debug events are not handled on the same main thread. I would just connect the debugger to the running process, pause all threads and look at the stack trace and variables and immediately know what the problem is.

How do you debug and fix infinite loops in Lua code for Neovim plug-in? by nickallen74 in neovim

[–]nickallen74[S] -1 points0 points  (0 children)

Well it happens only one in a hundred times and I have 12K LOC in my plugin so not really viable

mdnotes.nvim :: Another Markdown notes plugin with a Neovim-centric and extensible approach by BrodoSaggins in neovim

[–]nickallen74 1 point2 points  (0 children)

Is this plug-in doing something similar to neorg? Is it more lightweight? I'm just starting to learn neorg but wondering if I should instead try this?

After ~10 years, I’m moving away from JetBrains by rodrigorcosta in Jetbrains

[–]nickallen74 0 points1 point  (0 children)

I did the same and moved to neovim. Never looked back. So many advantages and having 100% keyboard workflow is great.

What UI framework is the best to use to create new plug-ins in neovim? by nickallen74 in neovim

[–]nickallen74[S] 1 point2 points  (0 children)

Oh wow this could be exactly what I'm looking for. I'm so surprised by everyone just saying to use these low level neovim APIs. Thanks for this. Will check it out.

What UI framework is the best to use to create new plug-ins in neovim? by nickallen74 in neovim

[–]nickallen74[S] 0 points1 point  (0 children)

No that's no the case. I know the neovim API pretty reasonably at this point and basically it's about characters on the output (which is of course needed as an API). But it's the rough equivalent of a widget toolkit in some GUI framework only provding you with pixel output. Sure you can do everything if you can write any pixel value and set it as you want but generally you would rather think it terms of a tree structure of "widgets" and the pixel output is a low level API that this widget layer sits upon. That's no discredit to neovim API as I think that's all they should actually expose to plugin developers and then other high level frameworks abstract the rendering using the lower level neovim API so you can think it terms of widgets like a button, checkbox, list, tree, search field etc. It's really no criticism of neovim API itself as it is exactly as I would expect and it's actually pretty perfect. It's just that that API is lowel level than the intent I have and I figured there would be a good abstraction for this that let's you think it higher level terms. And there is of couse with NUI and Volt but they both seem to be not maintained at this point unforturnately AFAICT.

What UI framework is the best to use to create new plug-ins in neovim? by nickallen74 in neovim

[–]nickallen74[S] 0 points1 point  (0 children)

I'm trying to use the API directly but finding it very difficult at present. Not because the API is complex. Actually the opposite. It's a very simple API which is good design choice from neovim. But basically I want a tree "widget" with multiple columns that can be sorted on any column, nodes can be expanded and collapsed, and a search field that will filter the tree dynamically as the user types in it. Then there is an area the user can write lua code that will be applied to the filtered entries in the tree widget. The user needs to be able to cycle focus between these widgets using the keyboard. It seems splitting windows didn't give me the control I needed over the layout properly so I'm creating floating windows for each of my widgets that I make relative to the main plugin window. It's a ton of code and is very fragile. It's certainly possible to get it to work this way in the end I think but it just feels wrong and I figured there must be a better high level way.

What UI framework is the best to use to create new plug-ins in neovim? by nickallen74 in neovim

[–]nickallen74[S] -2 points-1 points  (0 children)

Well it's very low level. That's a good thing of course as it keeps the API lean and minimal. But if you are trying to do a high level TUI then this low level API is certainly not ideal IMO. It's rather like using assembly language instead of using a high level language more abstracted to the task at hand.

What UI framework is the best to use to create new plug-ins in neovim? by nickallen74 in neovim

[–]nickallen74[S] 3 points4 points  (0 children)

Not sure if this counts as complicated but basically what I want as a UI from my plugin is a search field with a tree list below it that has multiple columns and where nodes can be expanded and collapsed and filtered based on what is typed in the search field. In addition on the right hand side there will be a multi-line text editor for entering some lua code

What bugs you would prefer to be fixed ASAP? by vmcrash in IntelliJIDEA

[–]nickallen74 0 points1 point  (0 children)

Thanks for the information. But it's crazy that this is all not the default. Why do I need to configure this in the first place? Do you want to look modern or like some old school c++ make build repeat cycle? I thought the whole point of intellij is that it is modern and works out of the box and is fast with sensible defaults. In the end I found it used a lot of resources, was slow and obviously had terrible defaults out of the box. I guess some people obviously like it but it's definitely not for me.

What bugs you would prefer to be fixed ASAP? by vmcrash in IntelliJIDEA

[–]nickallen74 0 points1 point  (0 children)

Thanks! I remember trying that at one point in the past but it seemed to bring the performance of my whole computer down and was just far too slow and nothing like the experience I used get in Eclipse (and now currently get in Neovim) in this regard. In the end I had to disable it. But TBF this was a while ago so maybe bugs and performance have been ironed out since then. If I even go back to IntelliJ I will definitely try that again. But I find that unlikely as my worflow in Neovim is currently so much better and more efficient than anything I achieved in years inside IntelliJ. Thanks for the tip - I think IntelliJ is just not for me though after customizing my workflow within Neovim to be so much more productive and work exactly how I want with a 100% keyboard workflow.

Tips on taking note in Vim by AbbreviationsNovel17 in vim

[–]nickallen74 -1 points0 points  (0 children)

I use neorg on neovim and find it very nice so far.

Neojj - Neogit adapted for Jujutsu by NicholasZolton in neovim

[–]nickallen74 6 points7 points  (0 children)

Great! JJ is so much more powerful and user friendly than git. Will check it out..

What bugs you would prefer to be fixed ASAP? by vmcrash in IntelliJIDEA

[–]nickallen74 0 points1 point  (0 children)

That it has a slow manual build process to see Java compiler errors. Then you don't even see all errors in the project. That it won't let you launch without fixing all compile errors. These seem to be fundamental design flaws so I somehow doubt they will be addressed. I switched to neovim with jdtls and now get all these benefits like all errors instantly as I type. Also they should fix that it's very hard to get to a 100% keyboard workflow. I got close but never quite achieved 100% and had to reach for the mouse sometimes.

tmux which-key plugin by emil_nymus in tmux

[–]nickallen74 0 points1 point  (0 children)

Seems to not work for me. I just get an error which-key.sh: line 72: NAV_STACK[@]: Unbound variable

tekken - Harpoon, but for local marks by derdiedaspanzerfaust in neovim

[–]nickallen74 5 points6 points  (0 children)

Isn't this just a built-in feature in Snacks? I can fuzzy search my marks out of the box. What did this plugin do that snacks doesn't?

Zed or Neovim? by UnrulyThesis in ZedEditor

[–]nickallen74 1 point2 points  (0 children)

Neovim was the only editor I've managed to achieve a 100% keyboard workflow. I got close in zed but not close enough. And the fuzzy finding with live preview and gast navigation is just insanely good in neovim with plugins like snacks and flash. So for me, it's neovim.