package-info.nvim icon indicating copy to clipboard operation
package-info.nvim copied to clipboard

Bug trying to edit a `package.json` with unsaved changes

Open pedro757 opened this issue 3 years ago • 3 comments

E5108: Error executing lua .../opt/package-info.nvim/lua/package-info/modules/core.lua:173: Vim(edit):E37 : No write since last change (add ! to override)

You can't run :e on an file with unsaved changes

https://github.com/vuki656/package-info.nvim/blob/10de4d0d50ec1d4d26118c4aa067a9d09e370c9c/lua/package-info/modules/core.lua#L171-L175

pedro757 avatar May 03 '22 23:05 pedro757

I'm able to reproduce this.

What do you think would be the preferred way to handle this?

Also, please follow the issue template next time.

vuki656 avatar May 04 '22 19:05 vuki656

Oh sorry, I didn't know there was an issue template, if you create an issue from this button it does not show any template

image

Could I ask, what does __reload_buffer do? I just removed it and it works

I don't know why you need to create a view and immediately restore it.

pedro757 avatar May 06 '22 00:05 pedro757

Hey, sorry for the late reply regarding this, I forgot about it.

Here is the PR regarding that.

TLDR: it keeps the cursor position after reload.

vuki656 avatar Jun 17 '22 14:06 vuki656