pub fn get_alternate_or_new() -> Option<Buffer>Expand description
Retrieves the alternate buffer or creates a new one if none exists.
The alternate buffer is the buffer previously visited, accessed via Nvim’s “#” register. If no alternate buffer exists (bufnr(“#”) < 0), a new buffer is created.
§Errors
- Retrieving the alternate buffer fails (notified via
crate::notify::error). - Creating a new buffer fails (falls back to
create).