mirror of
https://github.com/neovim/neovim.git
synced 2026-07-29 11:58:02 +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:
@@ -823,7 +823,9 @@ M.funcs = {
|
||||
desc = [=[
|
||||
The result is the name of a buffer. Mostly as it is displayed
|
||||
by the `:ls` command, but not using special names such as
|
||||
"[No Name]".
|
||||
"[No Name]". If the buffer represents a directory, the name
|
||||
ends with a path separator, unless it was changed by |:file| or
|
||||
|nvim_buf_set_name()|.
|
||||
If {buf} is omitted the current buffer is used.
|
||||
If {buf} is a Number, that buffer number's name is given.
|
||||
Number zero is the alternate buffer for the current window.
|
||||
|
||||
Reference in New Issue
Block a user