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

nvim does not throw IndexError when out of line in vim.current.buffer. #128

Closed
SirVer opened this issue Jul 14, 2015 · 6 comments
Closed

Comments

@SirVer
Copy link

SirVer commented Jul 14, 2015

The line to test is :py import vim; vim.current.buffer[100000]. In regular vim you'll get:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
IndexError: line number out of range

In nvim no error is thrown.

This was surfaced through this UltiSnips test which is the last one failing with neovim in my current test branch, which is nice.

On another note: I found out the hard way that nvim sets a bunch of options differently on startup (for example smarttab, autoindent and backspace) when started using -u NONE than vim. Is that intentional?

SirVer added a commit to SirVer/ultisnips that referenced this issue Jul 14, 2015
- Remove support for python 3.2 to reduce number of test cases and because
  it actually fails with Neovim. It is not a supported version anyways.
- Due to Neovim not handling fast typing through the console properly
  (neovim/neovim#2454), the typing is actually
  simulated through the Python client. We need to differentiate now if a
  keystroke is meant for the terminal or for the Vim session. Using
  neovim.input() introduces additional chances for races since inputs
  are not buffered but processed right away. This results in more
  retries for some tests.
- Neovim needs more parameters and configuration passed in through the
  test script. Added command line arguments for these.
- Skip an extra test under Neovim due to
  neovim/pynvim#128.
@bohrshaw
Copy link

I found out the hard way that nvim sets a bunch of options differently on startup (for example smarttab, autoindent and backspace) when started using -u NONE than vim. Is that intentional?

See neovim/neovim#2676.

@tarruda
Copy link
Member

tarruda commented Jul 16, 2015

@SirVer this needs to be fixed on the Neovim side, could you reopen on the main repository?

@tarruda tarruda closed this as completed Jul 16, 2015
@justinmk
Copy link
Member

It's because of neovim/neovim#2846 which is a feature.

@tarruda
Copy link
Member

tarruda commented Jul 16, 2015

It's because of neovim/neovim#2846 which is a feature.

Even so, we might be able to emulate this vim behavior with a session hook on script_host.py, see how vim.eval is emulated without compromising the API for newer interfaces: https://github.com/neovim/neovim/blob/master/runtime/autoload/provider/script_host.py#L173-L187

@justinmk
Copy link
Member

Sure, that sounds good. Just wanted to point it out.

@SirVer
Copy link
Author

SirVer commented Jul 18, 2015

Reopened as requested. I think @tarruda is right that this should be emulated - after all the promise is for the neovim python client to provide a vim compatible python interface.

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

4 participants