There appears to be some issue with vim-haredoc on Neovim v0.9.5:
Failed to source `/home/noah/.local/share/nvim/lazy/vim-haredoc/plugin/haredoc.vim`
vim/_editor.lua:0: FileType Autocommands for "hare"..script nvim_exec2() called at FileType Autocommands for "hare
":0../home/noah/.local/share/nvim/lazy/vim-haredoc/plugin/haredoc.vim, line 86: Vim(function):E126: Missing :endfu
nction
# stacktrace:
- vim/_editor.lua:0 _in_ **cmd**
The Haredoc function is not particularly complicated, so I'm not sure what is actually
going on. I'm happy to send over patches if we can figure it out (or maybe this is a
neovim bug?).
~ngp
Hi Noah,
Thanks for this report.
On Wed Feb 21, 2024 at 3:31 PM GMT, Noah Pederson wrote:
> There appears to be some issue with vim-haredoc on Neovim v0.9.5:>> Failed to source `/home/noah/.local/share/nvim/lazy/vim-haredoc/plugin/haredoc.vim`>> vim/_editor.lua:0: FileType Autocommands for "hare"..script nvim_exec2() called at FileType Autocommands for "hare> ":0../home/noah/.local/share/nvim/lazy/vim-haredoc/plugin/haredoc.vim, line 86: Vim(function):E126: Missing :endfu> nction>> # stacktrace:> - vim/_editor.lua:0 _in_ **cmd**>> The Haredoc function is not particularly complicated, so I'm not sure what is actually> going on. I'm happy to send over patches if we can figure it out (or maybe this is a> neovim bug?).>> ~ngp
I don't use neovim, only vim, though I'm certainly happy to make
vim-haredoc compatible with neovim.
plugin/haredoc.vim Line 85 does have `endfunction`, so that's werid.
I'm not familiar with the Lua+Neovim error message.
If you are willing to debug this and send a patch, I'd be happy to merge
it. Otherwise, I'll try Neovim this weekend.
Hope you're enjoying Hare.
b
On Wed Feb 21, 2024 at 4:07 PM CST, Byron Torres wrote:
> plugin/haredoc.vim Line 85 does have `endfunction`, so that's werid.
Yeah, the more I look at it the more I think this is either some subtle incompatible
change neovim has made to its vimscript or a bug.
> If you are willing to debug this and send a patch, I'd be happy to merge> it. Otherwise, I'll try Neovim this weekend.
I tested it in vim 8 and it worked fine, which confirms my hunch that it's a neovim
specific bug. I'll keep digging.
On Fri Feb 23, 2024 at 11:38 PM GMT, Noah Pederson wrote:
> On Wed Feb 21, 2024 at 4:07 PM CST, Byron Torres wrote:> > plugin/haredoc.vim Line 85 does have `endfunction`, so that's werid.>> Yeah, the more I look at it the more I think this is either some subtle incompatible> change neovim has made to its vimscript or a bug.>> > If you are willing to debug this and send a patch, I'd be happy to merge> > it. Otherwise, I'll try Neovim this weekend.>> I tested it in vim 8 and it worked fine, which confirms my hunch that it's a neovim> specific bug. I'll keep digging.
I just downloaded Neovim and played around a little. It seems that
removing haredoc.vim lines 24..29 puts to rest the "missing endfunction"
error message
24 let resolvecmd =<< trim eval CMD
25 awk '/use [a-zA-Z:]*{parent};/ {{
26 gsub("(use *|;.*)", "");
27 print $1 "::" "{base}"
28 }}' {expand("%")} 2>&-
29 CMD
`:help =<<` shows no mention of "eval", so this is probably a
Vim-specific feature.
So, this is probably gonna need a small rewrite if we want to achieve
compatibility, which is something I would like. Leveraging awk to read
the file is quite hacky anyway, and a viml-native solution would be an
improvement.
I'm gonna try briefly. You are welcome to write a patch also, using your
knowledge of neovim to make sure it's nvim-compatible.
Hi Noah,
I've written two commits to the 'dev' branch.
https://git.sr.ht/~torresjrjr/vim-haredoc/log/dev
* b931bd13 nvim: use floating window
* abfb2ca8 rewrite symbol resolution; achieve neovim compat
Would you like to give me feedback on them using your neovim setup?
The floating window could be resized and whatnot, but I'll probably
leave it for someone else to improve upon. It should work now.
On Sun Feb 25, 2024 at 9:22 AM CST, Byron Torres wrote:
> * b931bd13 nvim: use floating window> * abfb2ca8 rewrite symbol resolution; achieve neovim compat>> Would you like to give me feedback on them using your neovim setup?
That does appear to have fixed my issue in neovim!
> The floating window could be resized and whatnot, but I'll probably> leave it for someone else to improve upon. It should work now.
It's a bit large, but more annoying is the
> [Process exited 0]
at the end of the command output. I might have some time to look into this later today.
Thank you for the fixes!
On Sun Feb 25, 2024 at 5:22 PM GMT, Noah Pederson wrote:
> On Sun Feb 25, 2024 at 9:22 AM CST, Byron Torres wrote:> > * b931bd13 nvim: use floating window> > * abfb2ca8 rewrite symbol resolution; achieve neovim compat> >> > Would you like to give me feedback on them using your neovim setup?>> That does appear to have fixed my issue in neovim!
Awesome. I'll add these changes to master.
> > The floating window could be resized and whatnot, but I'll probably> > leave it for someone else to improve upon. It should work now.>> It's a bit large, but more annoying is the>> > [Process exited 0]>> at the end of the command output. I might have some time to look into this later today.
You may want to do something similar to what I did for Vim:
49 let minheight = 1 + system(
50 \ "haredoc -Ftty '"..symbol.."' 2>&1 | wc -l"
51 \ )
Then use that 'minheight' variable for the floating window. Not sure how
to handle the "[Process exited 0]" output.
Happy days
B