oni icon indicating copy to clipboard operation
oni copied to clipboard

oni 0.3.9 not working with nvim 0.3.3

Open vlcinsky opened this issue 5 years ago • 15 comments

Oni Version: 0.3.9 Neovim Version (Linux only): 0.3.3 Operating System: Debian Stretch

Issue: When nvim 0.3.3 installed, oni starts very slowly and then does not function. It is even not possible to get the ":" prompt.

Expected behavior: oni shall work with latest released nvim version.

Actual behavior: For nvim version 0.3.3 oni does not work.

Steps to reproduce: Install nvim 0.3.3 (I used nvim.appimage).

Have oni 0.3.9 installed (used deb package)

In default configuration (variable ONI_NEOVIM_PATH not set), oni starts but it takes few seconds more, then it is not possible to open a file or open the ":" prompt.

When ONI_NEOVIM_PATH is set to older version of nvim (I have version 0.3.0), oni works well.

vlcinsky avatar Jan 05 '19 23:01 vlcinsky

Can confirm not working after upgrade to neovim 0.3.2 too.

badosu avatar Jan 06 '19 19:01 badosu

I had the same issue today on MacOS after updating to nvim 0.3.3.

I don't think my solution will help you, as I am on a different OS, but it might help other Mac OS users.

Following #2590, I had been running Oni with the debug.neovimPath configuration key set to my global nvim command.

Commenting out the key in the ~/.config/oni/config.{js,tsx} did allow me to use successfully Oni, as it is now using the version of neovim packaged with the application.

zr0z avatar Jan 07 '19 05:01 zr0z

I can confirm, that explicitly setting value of "debug.neovimPath" to nvim version 0.3.0 allows me to use nvim 0.3 3.

It is just an workaround, the issue that oni does not work with the latest nvim version still persist.

vlcinsky avatar Jan 07 '19 20:01 vlcinsky

To keep things together (so we don't duplicate work). There's another issue on this #2704. I found the general reason for why it's breaking. But I don't know why exactly it's happening or how to fix it.

tldr; A call to the neovim API is not completing

mbkv avatar Jan 08 '19 04:01 mbkv

same issue on MacOS

hojas avatar Jan 09 '19 02:01 hojas

Archlinux too

$ pacman -Qs neovim
local/neovim 0.3.3-1
    Fork of Vim aiming to improve user experience, plugins, and GUIs
local/oni 0.3.9-1
    An IDE built around Neovim

pmav99 avatar Jan 10 '19 18:01 pmav99

neovim/neovim@4da5cb38d396d76d8072815d150725f7c9a85078 changed the behavior of the command line argument --embed to no longer imply --headless.

A pretty simple patch: losinggeneration/oni@da86cba15d14dc5c17aaf7b512f9ef53579654d7 is all that's needed to get Oni working again with nvim >= 0.3.2

losinggeneration avatar Jan 14 '19 17:01 losinggeneration

Updated the AUR package to depend on neovim<=0.3.1

badosu avatar Jan 17 '19 02:01 badosu

OK, for everyone having this problem (i.e., using NeoVIM versions >= 0.3.2), there is a very simple solution without reinstalling anything or downgrading nvim, or patching/rebuilding oni, or anything like that. I don't know why it was so difficult for the people who figured this out to post the most basic instructions for the most simple of fixes?

This is for Linux (assuming Oni was installed in /opt/Oni), but other OS's are similar, just find the resources/app/lib/browser/vendor.bundle.js file, wherever it lies on your filesystem (probably ...\resources\app\lib\browser\vendor.bundle.js on windows. Replace ... with where the oni stuff lives).

The solution to this is as simple as, editing the file /opt/Oni/resources/app/lib/browser/vendor.bundle.js (may need to use sudo, if it is owned by root): Search (and when I say search, I mean use the Search Command of your editor and not your eyes and fingers!) for the line that has: ...,"--embed","--"... (On my install, it was line # 874 in that file.)

Note: Don't include the ellipses (plural of ellipsis, as in ...) in your search - just the phrase highlighted in gray, above (it should start with a comma and end with a quote). The ellipses are just being used as placeholders for the omitted start/end text of that horrendously long line, to keep things simple.

And insert "--headless", in that line between the embed and -- strings, so it looks like this: ...,"--embed","--headless","--"...

Voila, problem solved in 30 seconds or less!

SteelBlueVision avatar Jan 17 '19 20:01 SteelBlueVision

@mgoldshteyn something like this for POSIX systems.

sed 's/"--embed",/"--embed","--headless",/' resources/app/lib/browser/vendor.bundle.js  > tmp.js
mv tmp.js resources/app/lib/browser/vendor.bundle.js

losinggeneration avatar Jan 17 '19 21:01 losinggeneration

@mgoldshteyn something like this for POSIX systems.

sed 's/"--embed",/"--embed","--headless",/' resources/app/lib/browser/vendor.bundle.js  > tmp.js
mv tmp.js resources/app/lib/browser/vendor.bundle.js

Just make sure you cd to the right starting directory first and you can use sponge or sed with replace in-place (i.e., --in-place) to avoid the need for a temporary file and a move.

SteelBlueVision avatar Jan 17 '19 22:01 SteelBlueVision

I specifically avoided that because in-place is handled differently between OS X & Linux (last I checked) I think something like -i.bak works on both the same way, but then leaves a file.bak behind.

losinggeneration avatar Jan 17 '19 23:01 losinggeneration

Hello, I am on Fedora 27 neovim 0.3.4 prebuilt binary added to the PATH oni 0.3.6

By modifying vendor.bundle.js as explained by @mgoldshteyn, with no other custom change, it worked for me, BUT only if I launch it from the terminal.

I am new to this software and I encountered other bugs which I don't know if are related to this 'hack'. So as for editing files it seem it's working but I couldn't say it doesn't cause errors/bug somewhere else.

palmier3 avatar Feb 11 '19 21:02 palmier3

I wish they fixed this in the next update, otherwise it would be annoying to have to do this on every new installation or update.

pencilcheck avatar Feb 23 '19 03:02 pencilcheck

I have no idea, if there is any next update to happen as there is ongoing work on onivim2

vlcinsky avatar Feb 23 '19 20:02 vlcinsky