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

[Bug] Give a proper error message for buffers that don't evaluate

Open wildwestrom opened this issue 3 years ago • 0 comments

Usually when I need a scratch buffer, it's to put information that I don't intend to execute. I used to use Emacs for notetaking but I'm using neovim now.

Right now, if I try to open a scratch buffer of type markdown, it gives me a cryptic error message.

Seems like you've sort of hardcoded that functionality. I'm not sure how you would like it to be instead though. https://github.com/n-shift/scratch.nvim/blob/95a533ac1042b2995b1386af73a4d1ea857339c0/lua/scratch/buffer.lua#L10-L14

Can you add filetypes for markdown, org, asciidoc, and plaintext? That should cover the major ones. Maybe also add json, yaml, xml, and other information types that also don't evaluate.

Steps:

  1. Run ex command :Telescope scratch md

Expected:

Open the buffer without issue.

Actual:

A cryptic error message is shown to me.

Workaround:

Just use :ScratchNew md

wildwestrom avatar Dec 08 '22 03:12 wildwestrom