mirror of
https://github.com/neovim/neovim.git
synced 2026-08-29 02:21:51 +00:00
fix(filetype): ensure directory bufname ends w/ slash sep #40552
Problem: `vim.filetype.match()` needs a cheap way to recognize directory buffers without doing filesystem stat work. Solution: Ensure full buffer names for directories end in a trailing slash. Now directory buffers can proceed through the normal 'filetype' path. Note side-effects: session and ShaDa buffer-list restore behavior must be compatible, so those + corresponding tests must be updated.
This commit is contained in:
@@ -942,6 +942,9 @@ void nvim_buf_del_var(Buffer buf, String name, Error *err)
|
||||
|
||||
/// Gets the full/absolute filepath of the buffer, or the buffer name for non-file buffers.
|
||||
///
|
||||
/// If the buffer represents a directory, the name ends with a path separator,
|
||||
/// unless it was changed by |:file| or |nvim_buf_set_name()|.
|
||||
///
|
||||
/// @param buf Buffer id, or 0 for current buffer
|
||||
/// @param[out] err Error details, if any
|
||||
/// @return Buffer name
|
||||
|
||||
Reference in New Issue
Block a user