Skip to content
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

After a PluginUpdate, I get errors: #167

Open
enmy211 opened this issue Sep 21, 2020 · 14 comments
Open

After a PluginUpdate, I get errors: #167

enmy211 opened this issue Sep 21, 2020 · 14 comments

Comments

@enmy211
Copy link

enmy211 commented Sep 21, 2020

Error during processing of function 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?

@GCBallesteros
Copy link
Contributor

GCBallesteros commented Sep 26, 2020

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!

@GCBallesteros
Copy link
Contributor

GCBallesteros commented Sep 26, 2020

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 746f220) 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.

@GCBallesteros
Copy link
Contributor

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!

@enmy211
Copy link
Author

enmy211 commented Sep 28, 2020

Now I get error when use "iron-send-motion"
Error function 47_save_pos:
line 6
E117: Unknown funksjon: nvim_buf_set_extmark

@GCBallesteros
Copy link
Contributor

@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?

@enmy211
Copy link
Author

enmy211 commented Sep 29, 2020

With NVIM v0.5.0-715-gc5ceefca7, I get a little bit different error:

Error while processing function 47_save_pos:
line 6
E118: To many parameters to function: nvim_buf_set_extmark

@GCBallesteros
Copy link
Contributor

@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:

  1. Remove 'hkrupty/iron.nvim' from init.vim
  2. Save, source init.vim and :PlugClean
  3. Add 'GCBallesteros/iron.nvim', save, source and :PlugInstall

Hope this helps.

@enmy211
Copy link
Author

enmy211 commented Sep 30, 2020

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!!!

@hkupty
Copy link
Collaborator

hkupty commented Oct 13, 2020

PR Merged now, @enmy211 can you check if master is fixed for you? Kudos to @GCBallesteros for the fix :)

@enmy211
Copy link
Author

enmy211 commented Oct 14, 2020

Yes, it works!

But the very first time I send "ironSendMotion" I get error:
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?

@GCBallesteros
Copy link
Contributor

@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.

@enmy211
Copy link
Author

enmy211 commented Oct 15, 2020

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 :-)

@GCBallesteros
Copy link
Contributor

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>

@hkupty
Copy link
Collaborator

hkupty commented Oct 15, 2020

I'll have a look at that @enmy211, thanks! And thanks once again @GCBallesteros for the work on identifying and debugging iron 🙂

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants