-
|
I've searched through Issues, Discussions, and Reddit but haven't found anyone asking about this (or maybe I'm just being stupid). How do I mark all live preview buffers displayed by consult as read-only before consult exits? This includes ripgrep, line, and all the others. I love that consult does 100% what neovim's telescope.nvim does without hijacking emacs native functionality – it just uses the native display methods. But one thing that's been bugging me is that the preview buffers aren't read-only, so I might accidentally change the content (It is not saved, but stills makes me uncomfortable). |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
|
The previewed file buffers are read-only for consult-grep. The files are only actually opened as regular read-write buffers if you leave the minibuffer during completion, such that editing is possible during completion. This is intentional. However accidental file modifications are almost impossible, since you have to manually leave the minibuffer. consult-line leaves the buffers as is. If your buffer is read-only it will stay read-only, if it is read-write it will stay read-write. consult-line does not change this status as a side affect, but I argue that consult-line does not increase the chances of accidental modification. If your buffer had been read-write before you could have modified it accidentally before that as well. |
Beta Was this translation helpful? Give feedback.
This must be your configuration. consult-find does not preview files by default as far as I can tell.
EDIT: Maybe you stumbled over a detail - if files are not yet open, they will be previewed in read-only
Preview:filenamebuffers. But if the file is already open, Consult will simply "preview" the already open buffer as is. Is this what you are noticing?Certainly, but it will be too inefficient. Affe works differently to support this, but has other downsides, since only few matches are shown.