Mercurial > vim
comparison runtime/autoload/dist/ft.vim @ 32519:eae7e7217f26 v9.0.1591
patch 9.0.1591: some "gomod" files are not recognized
Commit: https://github.com/vim/vim/commit/c9fbd2560f24180d2efa40028ed68427341d2d99
Author: Omar El Halabi <omar.el.halabi@freiheit.com>
Date: Mon May 29 19:59:45 2023 +0100
patch 9.0.1591: some "gomod" files are not recognized
Problem: Some "gomod" files are not recognized.
Solution: Check for "go.mod" file name before checking out the contents.
(Omar El Halabi, closes #12462)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 29 May 2023 21:00:04 +0200 |
parents | 8d7214baf422 |
children | c777d71cf397 |
comparison
equal
deleted
inserted
replaced
32518:fee0b6216514 | 32519:eae7e7217f26 |
---|---|
482 | 482 |
483 # Determine if *.mod is ABB RAPID, LambdaProlog, Modula-2, Modsim III or go.mod | 483 # Determine if *.mod is ABB RAPID, LambdaProlog, Modula-2, Modsim III or go.mod |
484 export def FTmod() | 484 export def FTmod() |
485 if exists("g:filetype_mod") | 485 if exists("g:filetype_mod") |
486 exe "setf " .. g:filetype_mod | 486 exe "setf " .. g:filetype_mod |
487 elseif expand("<afile>") =~ '\<go.mod$' | |
488 setf gomod | |
487 elseif IsLProlog() | 489 elseif IsLProlog() |
488 setf lprolog | 490 setf lprolog |
489 elseif getline(nextnonblank(1)) =~ '\%(\<MODULE\s\+\w\+\s*;\|^\s*(\*\)' | 491 elseif getline(nextnonblank(1)) =~ '\%(\<MODULE\s\+\w\+\s*;\|^\s*(\*\)' |
490 setf modula2 | 492 setf modula2 |
491 elseif IsRapid() | 493 elseif IsRapid() |
492 setf rapid | 494 setf rapid |
493 elseif expand("<afile>") =~ '\<go.mod$' | |
494 setf gomod | |
495 else | 495 else |
496 # Nothing recognized, assume modsim3 | 496 # Nothing recognized, assume modsim3 |
497 setf modsim3 | 497 setf modsim3 |
498 endif | 498 endif |
499 enddef | 499 enddef |