comparison runtime/scripts.vim @ 19607:d24e6844aabd v8.2.0360

patch 8.2.0360: yaml files are only recognized by the file extension Commit: https://github.com/vim/vim/commit/8eab73132838e977092d7b46f70b4ecf6274fd6a Author: Bram Moolenaar <Bram@vim.org> Date: Fri Mar 6 22:25:56 2020 +0100 patch 8.2.0360: yaml files are only recognized by the file extension Problem: Yaml files are only recognized by the file extension. Solution: Check for a line starting with "%YAML". (Jason Franklin)
author Bram Moolenaar <Bram@vim.org>
date Fri, 06 Mar 2020 22:30:04 +0100
parents 432714f5c0f7
children 847a300aa244
comparison
equal deleted inserted replaced
19606:53ee30ecdacf 19607:d24e6844aabd
374 " Erlang terms 374 " Erlang terms
375 " (See also: http://www.gnu.org/software/emacs/manual/html_node/emacs/Choosing-Modes.html#Choosing-Modes) 375 " (See also: http://www.gnu.org/software/emacs/manual/html_node/emacs/Choosing-Modes.html#Choosing-Modes)
376 elseif s:line1 =~? '-\*-.*erlang.*-\*-' 376 elseif s:line1 =~? '-\*-.*erlang.*-\*-'
377 set ft=erlang 377 set ft=erlang
378 378
379 " YAML
380 elseif s:line1 =~# '^%YAML'
381 set ft=yaml
382
379 " CVS diff 383 " CVS diff
380 else 384 else
381 let s:lnum = 1 385 let s:lnum = 1
382 while getline(s:lnum) =~# "^? " && s:lnum < line("$") 386 while getline(s:lnum) =~# "^? " && s:lnum < line("$")
383 let s:lnum += 1 387 let s:lnum += 1