annotate runtime/syntax/syntax.vim @ 29479:5c390aa28f44 v9.0.0081

patch 9.0.0081: command line completion of user command may have duplicates Commit: https://github.com/vim/vim/commit/c2842adfb2ca0637f13e2793fefa18e7818684f9 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jul 26 17:23:47 2022 +0100 patch 9.0.0081: command line completion of user command may have duplicates Problem: Command line completion of user command may have duplicates. (Dani Dickstein) Solution: Skip global user command if an identical buffer-local one is defined. (closes #10797)
author Bram Moolenaar <Bram@vim.org>
date Tue, 26 Jul 2022 18:30:03 +0200
parents f73a9bdff3a3
children 4027cefc2aab
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax support file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Maintainer: Bram Moolenaar <Bram@vim.org>
28517
f73a9bdff3a3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28433
diff changeset
3 " Last Change: 2022 Apr 12
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 " This file is used for ":syntax on".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " It installs the autocommands and starts highlighting for all buffers.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 if !has("syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 " If Syntax highlighting appears to be on already, turn it off first, so that
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 " any leftovers are cleared.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 if exists("syntax_on") || exists("syntax_manual")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 so <sfile>:p:h/nosyntax.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 " Load the Syntax autocommands and set the default methods for highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 runtime syntax/synload.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 " Load the FileType autocommands if not done yet.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 if exists("did_load_filetypes")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 let s:did_ft = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 filetype on
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 let s:did_ft = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 " Set up the connection between FileType and Syntax autocommands.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 " This makes the syntax automatically set when the file type is detected.
28433
367439b95aba patch 8.2.4741: startup test fails
Bram Moolenaar <Bram@vim.org>
parents: 7
diff changeset
31 " Avoid an error when 'verbose' is set and <amatch> expansion fails.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 augroup syntaxset
28433
367439b95aba patch 8.2.4741: startup test fails
Bram Moolenaar <Bram@vim.org>
parents: 7
diff changeset
33 au! FileType * 0verbose exe "set syntax=" . expand("<amatch>")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 augroup END
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 " Execute the syntax autocommands for the each buffer.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 " If the filetype wasn't detected yet, do that now.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 " Always do the syntaxset autocommands, for buffers where the 'filetype'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 " already was set manually (e.g., help buffers).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 doautoall syntaxset FileType
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 if !s:did_ft
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 doautoall filetypedetect BufRead
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 endif