codesnap.nvim icon indicating copy to clipboard operation
codesnap.nvim copied to clipboard

[Feat / Bug?] Let CodeSnaps be taken from unsaved buffers

Open jonsch318 opened this issue 1 year ago • 1 comments

I am working on a presentation that involves code, thus CodeSnap is pretty much perfect (thanks :)). But i have some examples that i don't need as written code but want as a snippet in the presentation.

But when I am create a new unsaved file and taking a CodeSnap from it, the Lua Runtime says:

Value of type () couldn't be pushed on the stack: Lua runtime error: No such file .

Is it possible to read the buffer content not the written out file on disk? This would potentially help with accidentally unsaved files aswell?

Thanks

jonsch318 avatar Sep 15 '24 09:09 jonsch318

Hi @jonsch318 thx for this issue reporting, looks like this is bug, I'm try to reproduce this case on my computer, but everything works properly.

  1. I create a file named hello.js
  2. Code some
  3. Take code snapshot

https://github.com/user-attachments/assets/6afecad3-b8ea-4948-9ebd-afe8f515c6a7

The content of hello.js is unsaved, but it works properly. Can you provide screen record if I understand incorrect

mistricky avatar Sep 22 '24 04:09 mistricky