iron.nvim
iron.nvim copied to clipboard
After a PluginUpdate, I get errors:
Error during processing of function <SNR>47_save_pos: line 6: E117: Unknown function: nvim_buf_set_extmark
I have: NVIM v0.4.4 Python 3.7.3 pynvim 0.4.3 Ubuntu 18.04.5 LTS
Any idea?
EDIT: NOT the same issue!
Hi, same error here. As soon as I type ctr in normal mode, the following error message shows up:
Error detected while processing function <SNR>38_save_pos:
line 6:
E118: Too many arguments for function: nvim_buf_set_extmark
System
Iron: commit 746f2... Nvim: commit b9ceac46... (HEAD as of 24 September 2020) REPL: ipython OS: macOS Catalina 10.15.6
Config
local iron = require('iron')
iron.core.set_config {
preferred = {
python = "ipython"
}
}
Thanks!
I just did a git bisect and found the first commit to introduce errors to be:
33d80dbf0c964c...
Then armed with my zero knowledge of Lua and Vimscript I attempted a fix.
Commenting out all the code between 377 and 401 in init.lua (commit 746f220f) plus modifying the map of iron-send-line to its state prior to 33d80 in iron.vim eliminated both the problems described in this issue and on issue #168.
I have probably broken a few things along the way but for now it does the trick for me.
EDIT: Upon further digging it looks like the problem is on the calls to vim.api.nvim_buf_set_extmark. The plugin pass 6 parameters but from the docs via :h nvim_buf_set_extmark it looks like it just takes 5.
Hi @enmy211, I have created a pull request that I think should fix your problem. You can also try for now GCBallesteros/iron.nvim while we wait for a more definitive solution.
Cheers!
Now I get error when use "iron-send-motion" Error function <SNR>47_save_pos: line 6 E117: Unknown funksjon: nvim_buf_set_extmark
@enmy211 our errors are actually different.... sorry for having hijacked your issue, I should have read more closely. Your issue is that nvim_buf_set_extmark doesn't look to be available on nvim 0.4.4. You may want to try a newer release?
With NVIM v0.5.0-715-gc5ceefca7, I get a little bit different error:
Error while processing function <SNR>47_save_pos: line 6 E118: To many parameters to function: nvim_buf_set_extmark
@enmy211 That was the error I was getting which I fixed on the pull request. While we wait for a fix here, can you give it a shot to using my version of the plugin, GCBallesteros/iron.nvim? Depending on how your plugin manager works you will have to delete the old plugin, update and install the new one. Using Plug, that would be:
- Remove 'hkrupty/iron.nvim' from init.vim
- Save, source init.vim and :PlugClean
- Add 'GCBallesteros/iron.nvim', save, source and :PlugInstall
Hope this helps.
Still with NVIM v0.5.0-715-gc5ceefca7:
Error while processing function 47_ironSendMotion: line 1: E5108: Error executing lua /home/eivind/.vim/bundle/iron.nvim/lua/iron/init.lua:385: line value outside range
I tried more and it worked!!! The error pop up a couple of times. I tried more and the error haven't popped up since.
Thank you for fixing this.
I use this plugin almost every day. Until now I have used Jupyter lab, which isn't my first choice. Now I am on track again!!!
I'll buy you some bear!!!
PR Merged now, @enmy211 can you check if master is fixed for you? Kudos to @GCBallesteros for the fix :)
Yes, it works!
But the very first time I send "ironSendMotion" I get error: <SNR>43_ironSendMotion: line 1 E5108: Error executing lua /home/eivind/.vim/bundle/iron.nvim/lua/iron/init.lua:392: line value outside range
After that: No errors.
That's ok.
Thank you. I will buy you some beer (not bear). Paypal?
@enmy211 That's no good, something is still wrong there :) Can you give more details on your workflow from starting nvim to hitting the error? Keystroke for keystroke if necessary. It's hard to diagnose without being able to reproduce first.
P.S. If it's not a bear then I'm not interested ;), but @hkupty may be interested in the beer, he is the one that put in the hard work.
I got to my working directory and fire up nvim with xxxx.py. In my init.vim I have:
map <leader>9 <Plug>(iron-send-motion)<CR>
I got to the first line and press my leader-key and the mentioned error show up. I press enter to continue, the command execute ok and IPython 7.5.0 pops up in a new window.
While trying this i discovered exactly where the error occur.
-
When I don't have a empty line at the top of text, the error occur.
-
If I have a empty line at the top of text, then no error pops up.
I hope this help :-)
I can reproduce it. It looks like the buffer marks are not set correctly when iron-send-motion is called when a REPL is not yet instantiated.
@enmy211 May I suggest that in the meantime you start the REPL before doing the first iron-send-motion? That's the way I usually do it. Just call :IronRepl from normal mode or make yourself a shortcut. e.g. nmap <leader>8 :IronRepl<CR>
I'll have a look at that @enmy211, thanks! And thanks once again @GCBallesteros for the work on identifying and debugging iron :slightly_smiling_face:
As for the beer, I guess I'll allow me one when I can get back to maintaining iron properly.. Sorry for not being able to keep up.