Skip to content

Fix #394: Avoid problem happening.#395

Merged
junegunn merged 1 commit into
junegunn:masterfrom
starcraftman:small_fixes
Jan 29, 2016
Merged

Fix #394: Avoid problem happening.#395
junegunn merged 1 commit into
junegunn:masterfrom
starcraftman:small_fixes

Conversation

@starcraftman

Copy link
Copy Markdown
Contributor

This is largely a response to fix: #394.

Maps are only bound on prepare when function is guaranteed synchronous, else delay until finish of update/install to be done in s:finish(). Avoids the accidental neovim breakage experienced in that issue.

Also, small typo with respect to the platform test, print doesn't need brackets for python 2.

TODO:

  • Don't write pending updates if no commit/tag opts.
  • Resolve buffer reuse.

@junegunn

Copy link
Copy Markdown
Owner

Thank you. The remaining problem is as we continuously reuse the buffer when it's open, it fails when you do PlugUpdate again while the window is open and press D. We can either 1. unmap those mappings, 2. or change the code not to reuse the buffer but simply wipes it out and create another one (enew?).

@starcraftman

Copy link
Copy Markdown
Contributor Author

@junegunn Good point, I'll add that to my todo.

* Do not map during prepare when function can be async.
Delay to s:finish()
* Always create new buffer, due to mappings change.
* Don't show Pending updates when no appropriate plugs.
* No need for print brackets on python 2.
@starcraftman

Copy link
Copy Markdown
Contributor Author

@junegunn Anything else? I went with simply destroying it every time by invoking q.

@junegunn

Copy link
Copy Markdown
Owner

How about enew?

  if s:switch_in()
    enew
  else
    call s:new_window()
  endif

This clears the buffer (bufhidden=wipe) and its maps but reuses the window, so the size of the window is retained if the user previously resized it for some reason.

@junegunn

Copy link
Copy Markdown
Owner

After a second thought, I think q (which is essentially bd) is safer. A user might tab split the buffer :)

junegunn added a commit that referenced this pull request Jan 29, 2016
@junegunn junegunn merged commit 03590d8 into junegunn:master Jan 29, 2016
@junegunn

Copy link
Copy Markdown
Owner

👍

@starcraftman starcraftman deleted the small_fixes branch January 29, 2016 21:03
@starcraftman

Copy link
Copy Markdown
Contributor Author

No problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

weird neovim key not present in dictionary errors

2 participants