A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/neovim/neovim/commit/6c86079fa07d46ba9627fc312a6d7818f4b7a2ca below:

normalize slashes in file paths · neovim/neovim@6c86079 · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+9

-2

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+9

-2

lines changed Original file line number Diff line number Diff line change

@@ -1357,6 +1357,11 @@ end

1357 1357 1358 1358

local pattern_sorted = sort_by_priority(pattern)

1359 1359 1360 +

---@private

1361 +

local function normalize_path(path)

1362 +

return (path:gsub("\\", "/"))

1363 +

end

1364 + 1360 1365

--- Add new filetype mappings.

1361 1366

---

1362 1367

--- Filetype mappings can be added either by extension or by filename (either

@@ -1419,11 +1424,11 @@ function M.add(filetypes)

1419 1424

end

1420 1425 1421 1426

for k, v in pairs(filetypes.filename or {}) do

1422 -

filename[k] = v

1427 +

filename[normalize_path(k)] = v

1423 1428

end

1424 1429 1425 1430

for k, v in pairs(filetypes.pattern or {}) do

1426 -

pattern[k] = v

1431 +

pattern[normalize_path(k)] = v

1427 1432

end

1428 1433 1429 1434

if filetypes.pattern then

@@ -1455,6 +1460,8 @@ function M.match(name, bufnr)

1455 1460

-- wish to perform filetype detection on buffers other than the current one.

1456 1461

bufnr = bufnr or api.nvim_get_current_buf()

1457 1462 1463 +

name = normalize_path(name)

1464 + 1458 1465

-- First check for the simple case where the full path exists as a key

1459 1466

local path = vim.fn.resolve(vim.fn.fnamemodify(name, ":p"))

1460 1467

if dispatch(filename[path], path, bufnr) then

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4