-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[neovim] PlugUpdate/Install as start commands don't show any UI #278
Comments
So its vim or neovim?? |
Neovim, sorry for the typo :( |
Running the latest neovim? |
Yeah, latest neovim version + latest neovim python-client.
To be clear vim isn't affected by this problem. |
Could be a neovim issue. It worked for me, until I updated neovim this morning ( |
Just did a rapid check and found out that this is the commit in neovim causing the bug in vim-plug neovim/neovim@7475c1c and the respective PR neovim/neovim#2846 The first comment to the first diff is probably the reason why it doesn't work. |
Oh god I fell stupid, this makes more sense diff --git a/plug.vim b/plug.vim
index 9eb11fc..abef6eb 100644
--- a/plug.vim
+++ b/plug.vim
@@ -1069,6 +1069,7 @@ class Buffer(object):
def __init__(self, lock, num_plugs, is_pull, is_win):
self.bar = ''
self.event = 'Updating' if is_pull else 'Installing'
+ self.firstTime = True
self.is_win = is_win
self.lock = lock
self.maxy = int(vim.eval('winheight(".")'))
@@ -1121,7 +1122,13 @@ class Buffer(object):
lnum = 3
else:
lnum = 3
- curbuf.append(msg, lnum)
+
+ if self.firstTime:
+ curbuf.append("", lnum-1)
+ curbuf.append(msg, lnum-1)
+ self.firstTime = False
+ else:
+ curbuf.append(msg, lnum)
self.header()
except vim.error: |
@choco Interesting.I just tried NVIM 0.0.0-alpha+201509080123 (compiled Sep 8 2015 10:44:34)
Commit: dc9652e68de163290abee880a74bf1727c715a1e
Build type: RelWithDebInfo
Compilation: /usr/lib/ccache/cc -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -fstack-protector --param ssp-buffer-size=4 -DINCLUDE_GENERATED_DECLARATIONS -DHAVE_CONFIG_H -I/home/starcraftman/nv/src/neovim/build/config -I/home/starcraftman/nv/src/neovim/src -I/home/starcraftman/nv/src/neovim/.deps/usr/include -I/home/starcraftman/nv/src/neovim/.deps/usr/include -I/home/starcraftman/nv/src/neovim/.deps/usr/include/luajit-2.0 -I/home/starcraftman/nv/src/neovim/.deps/usr/include -I/home/starcraftman/nv/src/neovim/.deps/usr/include -I/home/starcraftman/nv/src/neovim/.deps/usr/include -I/home/starcraftman/nv/src/neovim/.deps/usr/include -I/usr/include -I/home/starcraftman/nv/src/neovim/build/src/nvim/auto -I/home/starcraftman/nv/src/neovim/build/include
Compiled by starcraftman@cosmos
Optional features included (+) or not (-): +acl +iconv +jemalloc
For differences from Vim, see :help vim-differences
system vimrc file: "$VIM/nvimrc"
user vimrc file: "~/.nvimrc"
2nd user vimrc file: "~/.nvim/nvimrc"
user exrc file: "~/.exrc"
fall-back for $VIM: "/home/starcraftman/nv/share/nvim" I don't know what's going on with you guys. I am using my dev box to do that test, maybe it has some local modification. Downloading a vagrant image to do an isolated test. Regarding your last message, is that a proposed patch you find resolves this bug? |
@choco |
@choco @starcraftman |
This is the exception raised from
The behavior is inconsistent with Vim, so it definitely looks like a bug of nvim, doesn't it? |
@starcraftman Yes I'm using brew, but I can reproduce it even by compiling by hand on a fresh vagrant image. @junegunn I'm not sure they consider it a bug, reading the discussion on the pull request it seems to me that if we want to append text at the end of the buffer we have to use diff --git a/plug.vim b/plug.vim
index 9eb11fc..96cbce8 100644
--- a/plug.vim
+++ b/plug.vim
@@ -1121,7 +1121,11 @@ class Buffer(object):
lnum = 3
else:
lnum = 3
- curbuf.append(msg, lnum)
+
+ if lnum == len(curbuf):
+ curbuf.set_line_slice(-1, -1, False, True, msg)
+ else:
+ curbuf.append(msg, lnum)
self.header()
except vim.error: But that function isn't available in vim. |
@junegunn Ah yes, this looks familiar. I reported an inconsistency like this a long time ago to the python neovim provider. There was an off by 1 bug happening between my invocation (and what I expected vim to do) & the end result that was being received inside nvim. Interesting note, reason I was still working was I wasn't using the python version. I made the mistake of testing nvim on my main dev box, that has a bug breaking the Edit: I should probably do a fresh install, I think it is 3 upgrades old. @choco Yes, I was afraid that was what had happened. I can see where they are coming from, but I wouldn't have broken such long standing behaviour of I will test this new patch against my alternate machines nvim, seems reasonable if works. |
@choco
so I would say that it's a bug. |
@junegunn I'll open a issue there then and see what they think.
diff --git a/plug.vim b/plug.vim
index 9eb11fc..96cbce8 100644
--- a/plug.vim
+++ b/plug.vim
@@ -1121,7 +1121,11 @@ class Buffer(object):
lnum = 3
else:
lnum = 3
- curbuf.append(msg, lnum)
+
+ if lnum == len(curbuf):
+ curbuf.append(msg)
+ else:
+ curbuf.append(msg, lnum)
self.header()
except vim.error: |
@choco The document does not say that it's not allowed to append below the last line, and it works just as expected in Vim. The real problem is the line number is off by one as @starcraftman pointed out. Try |
@choco The only stupid programmer, is the one who writes something and refuses to improve upon it. Pride cometh before the fall. I can reproduce the bug now, but for some odd reason the patch doesn't fix the +PlugUpdate issue on my notebook. I'm willing to say it might be my messed up dev boxes though (as first time), I'm getting another vagrant box to try, first one wasn't right. @junegunn I am disappointed that the off by 1 bug I reported back in April is still present. |
@junegunn Oh god I didn't notice that..... @starcraftman diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c
index 12c97cf..ce3e64d 100644
--- a/src/nvim/api/buffer.c
+++ b/src/nvim/api/buffer.c
@@ -467,7 +467,7 @@ void buffer_insert(Buffer buffer,
ArrayOf(String) lines,
Error *err)
{
- buffer_set_line_slice(buffer, lnum, lnum, false, true, lines, err);
+ buffer_set_line_slice(buffer, lnum, lnum, true, false, lines, err);
}
/// Return a tuple (row,col) representing the position of the named mark Can you guys apply this with the last patch for vim-plug up there and test if everything works? |
@choco So I set up my clean Ubuntu 14.04 vagrant. Regarding your two different patches:
diff --git a/plug.vim b/plug.vim
index 9eb11fc..97711a8 100644
--- a/plug.vim
+++ b/plug.vim
@@ -1073,6 +1073,8 @@ class Buffer(object):
self.lock = lock
self.maxy = int(vim.eval('winheight(".")'))
self.num_plugs = num_plugs
+ if G_NVIM:
+ vim.current.buffer.append('')
def _where(self, name):
""" Find first line with name in current buffer. Return line num. """
@@ -1121,7 +1123,11 @@ class Buffer(object):
lnum = 3
else:
lnum = 3
- curbuf.append(msg, lnum)
+
+ if lnum == len(curbuf):
+ curbuf.append(msg)
+ else:
+ curbuf.append(msg, lnum)
self.header()
except vim.error:
|
|
@starcraftman Not sure if I want to have temporary workaround for the bug in our code even if it's trivial. And I don't think they should insist they can just change the behavior when the original behavior is universal across |
And note that |
@junegunn No disagreement from me, I mainly use vim anyway. Then this ticket stays open until nvim gets a patch to conform to expected vim if_pyth behaviour. |
@choco I was wondering about state of this issue since your neovim PR seems merged. Is there more work to be done? |
@starcraftman The PR I submitted fixed both the bugs described here, but I had to remove the fix for the append after the last line. They want me to implement that on the python side of things. |
@choco I see, not knowing python is definitely an impediment. As a python guy, I am not super impressed by their python-client. Seems like after putting it together quickly, it has become a non priority for the main devs. If I get some time I may try and help with the PR. Been a bit busy on my own new python project. It might be easier for you to learn python with, I think it is laid out a bit better. Python is pretty straightforward, many tutorials to learn from. The main gotcha most people find odd is decorators. See this tutorial for a quick rundown. They are useful, but hardly necessary and sometimes just complicate code. |
@starcraftman Hey, thank you so much for your help :) Finally finished my exams session, so I'll be able to dive into Python in the next couple of weeks :D |
@choco Good to hear, hope you did well. Have fun with python, in my opinion one of the better languages I've used. If you have python questions, feel free to ping me from one of your repos or on freenode. We should probably keep any further comments here to the issue at hand. |
still have this problem in latest neovim can anyone help me?
|
@treri Hi, for now start neovim normally and then issue PlugUpdate/PlugInstall. In order to be fixed, either the jobwait function would have to be patched in neovim to support the starting use case or the python neovim client needs to receive aforementioned patch that @choco described. The latter seems more likely, but I don't think either of us have worked on it. |
neovim/neovim#4083 seems to have fixed this, can anyone else check so we can close this? |
@choco I installed the latest neovim/neovim@28d3def from homebrew, it had been fixed. |
Hello, a couple of days ago I updated vim-plug to the latest version.
Today I tried to run the usual
nvim +PlugUpdate
and even though theupdate is performed correctly the UI isn't updated/shown until the
process is finished. The same happens when running PlugInstall.
Everything works correctly if I execute both commands when neovim
has already started.
The issue seems to have been introduced with #227 but I don't
understand if it's something expected with that change, or I'm experiencing a bug.
The text was updated successfully, but these errors were encountered: