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

Running inside Oni #10

Open
numirias opened this issue May 26, 2018 · 8 comments
Open

Running inside Oni #10

numirias opened this issue May 26, 2018 · 8 comments
Labels
bug Something isn't working

Comments

@numirias
Copy link
Owner

As reported by @CrossR, running Semshi inside Oni raises an error when opening a Python file:

        if not self._options.active: # pylint: disable=protected-access
AttributeError: 'NoneType' object has no attribute 'active'

The cause seems to be that Semshi does some initialization on BufEnter, however Oni doesn't always trigger that event first, so Semshi may be uninitialized when a Python file is opened.

@numirias
Copy link
Owner Author

numirias commented May 26, 2018

@CrossR Do you know if Oni implements buffer highlighting? After some quick tests, it seems calls like nvim_buf_add_highlight() don't have any effect.

Semshi relies on that API for its highlighting, so without it the plugin wouldn't be of much use inside Oni anyway.

Edit: Sorry, my bad. There seems to be another unrelated issue with Oni not recognizing Semshi's highlight groups, therefore not displaying the highlights.

@CrossR
Copy link

CrossR commented May 26, 2018

It could be the Oni is overriding some of the events Semshi is using somehow.

There is a tonne of autocmds setup over here : https://github.com/onivim/oni/blob/master/vim/core/oni-core-interop/plugin/init.vim

I'm going to try and remove them and see if that changes the behaviour of Semshi.
And it should work for highlights, or at least Oni uses them in a few places for LSP related bits.

@numirias
Copy link
Owner Author

And it should work for highlights, or at least Oni uses them in a few places for LSP related bits.

Yep, I could make highlighting work after re-applying the highlight groups in my init.vim. However, I noted refreshing highlights in large files seems a bit slower than in neovim directly and some highlights are still missing -- I'll see what I can do to improve that (or whether its a bug in Oni).

@CrossR
Copy link

CrossR commented May 26, 2018

Yep, I could make highlighting work after re-applying the highlight groups in my init.vim.

There is certainly a known issue where highlights from a users init.vim are being clobbered by Oni settings, wouldn't surprise me if that is popping up here again. Its something I'm hoping to look into from this next week, so I'll see if fixing that helps as well.

@numirias
Copy link
Owner Author

It looks like none of VimEnter, BufEnter and GUIEnter is triggered (or gets through to Semshi) when starting up Oni with a Python file. Want me to file an issue over there?

@CrossR
Copy link

CrossR commented May 26, 2018

Sure! Would be good to have an issue tracking that. I'm intending to mess with the Python API so I'll hopefully clean up these bugs first.

@numirias
Copy link
Owner Author

Just to let you know, I made a change so that Semshi ensures initialization irrespective of the event order (83f56bf) as this has also caused problems elsewhere (#11) - just in case you're still investigating and seeing changed behavior.

Now, the only major difference when running inside Oni seems to be that it doesn't apply (or clears) Semshi's highlight group declarations which therefore need to be re-applied manually.

@132ikl
Copy link

132ikl commented Jun 20, 2019

As an addendum, the selected word higlight only works if you reload the colorscheme, or run :hilight, strangely enough. :redraw does not do anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants