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

> pull request was actually highjacking empty buffers #294

Closed
kassio opened this issue Jul 25, 2020 · 5 comments · Fixed by #300
Closed

> pull request was actually highjacking empty buffers #294

kassio opened this issue Jul 25, 2020 · 5 comments · Fixed by #300

Comments

@kassio
Copy link
Owner

kassio commented Jul 25, 2020

pull request was actually highjacking empty buffers

What do you mean by this? It was making sure no empty buffer is created. Was it causing any issues for you?

On my flow I don't have this bug

I figured out that its caused when hidden is set. I guess then the empty buffer preserves. If hidden is not set it gets deleted. Maybe that's the reason why you don't have this bug. I have below some instructions how to reproduce it.

Minimal vimrc

cal plug#begin($XDG_DATA_HOME.'/nvim/plugins')
Plug 'kassio/neoterm'
cal plug#end()
set hidden

Steps to reproduce

  1. echo foo > foo
  2. nvim foo
  3. :Topen | b# | Topen | ls<cr>

Actual Behavior

The last command ls shows that besides foo also a second empty buffer with the name [No Name] exists.

Expected Behavior

No empty buffer should be created.

Cause of the Problem

The commit cb685fd makes the function s:create_window create a new empty buffer which doesn't get deleted when hidden is set.

Originally posted by @astier in #285 (comment)

@kassio kassio added the bug label Jul 25, 2020
@kassio
Copy link
Owner Author

kassio commented Jul 26, 2020

What do you mean by this?

Instead of creating a split window, when using that code, on re-opening a neoterm it opened in the current window (hijacking) the current window, instead of creating a split window even when passing a mod. Exemple:

hijack


Following the reproduce steps I wasn't able to replicate the error:

Kapture 2020-07-26 at 19 48 33

@astier
Copy link
Contributor

astier commented Jul 26, 2020

Instead of creating a split window, when using that code, on re-opening a neoterm it opened in the current window (hijacking) the current window, instead of creating a split window even when passing a mod

In my case Topen opens a new terminal in the current window and not in a split-window. But you are right. It breaks reopening a terminal in a vertical split.

Following the reproduce steps I wasn't able to replicate the error

This is what I get:

neoterm

I saw in your last gif that when you try to open foo you get some error messages like it couldn't load something. And at the first line in the file foo there are some red markers. So it seams like its not really a minimal vimrc. If so could you pls repeat it with only the minimal vimrc which I posted above?

Other than that I really don't know what else could be the difference. I am using nvim v0.4.3 and neoterm with the latest commit f4399a0.

@collegeimprovements do you still have this bug? Could you try to reproduce the bug with the instructions I gave above?

@astier
Copy link
Contributor

astier commented Jul 26, 2020

@kvalv do you still have this bug? Could you try to reproduce the bug with the instructions I gave above? I am mentioning you because you said that you have the bug in issue #285.

kassio added a commit that referenced this issue Jul 27, 2020
When re-opening a neoterm sometimes it creates a new empty buffer.
To avoid that, check for neoterm buffer before falling back to `enew`.

Fixes #294.
@kassio
Copy link
Owner Author

kassio commented Jul 27, 2020

@astier you're right. I was able to replicate. Can you check if #300 fixes it, please?

@astier
Copy link
Contributor

astier commented Jul 27, 2020

It fixes the issue for me. I hope it doesn't break anything else. Thank you very much for your help.

kassio added a commit that referenced this issue Jul 28, 2020
When re-opening a neoterm sometimes it creates a new empty buffer.
To avoid that, check for neoterm buffer before falling back to `enew`.

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

Successfully merging a pull request may close this issue.

2 participants