A RetroSearch Logo

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

Search Query:

Showing content from https://github.com/neovim/neovim/commit/8ade8009ee1fb508bf94ca6c8c3cd288f051c55b below:

Add typescript extension to filetype detection (#… · neovim/neovim@8ade800 · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+11

-0

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+11

-0

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

@@ -19,6 +19,10 @@ local function starsetf(ft)

19 19

}}

20 20

end

21 21 22 +

local function getline(bufnr, lnum)

23 +

return api.nvim_buf_get_lines(bufnr, lnum-1, lnum, false)[1]

24 +

end

25 + 22 26

-- Filetypes based on file extension

23 27

local extension = {

24 28

-- BEGIN EXTENSION

@@ -635,6 +639,13 @@ local extension = {

635 639

tssop = "tssop",

636 640

tutor = "tutor",

637 641

twig = "twig",

642 +

ts = function(path, bufnr)

643 +

if getline(bufnr, 1):find("<%?xml") then

644 +

return "xml"

645 +

else

646 +

return "typescript"

647 +

end

648 +

end,

638 649

tsx = "typescriptreact",

639 650

uc = "uc",

640 651

uit = "uil",

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