Mercurial > vim
annotate runtime/ftplugin/javascript.vim @ 34658:224d4a792264 v9.1.0213
patch 9.1.0213: CI: MS-Windows fails in test_winfixbuf
Commit: https://github.com/vim/vim/commit/aed6554b46bbba39bcb22e49cc731176cd75789b
Author: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Date: Thu Mar 28 09:48:34 2024 +0100
patch 9.1.0213: CI: MS-Windows fails in test_winfixbuf
Problem: CI: MS-Windows fails in test_winfixbuf
(after v9.1.208)
Solution: Instead of skipping the test, write the file
so it exists on disk, to verify that MS-Windows
short filename expansion is successful.
(Sean Dewar)
related: #14286
Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 28 Mar 2024 10:00:07 +0100 |
parents | 8ae680be2a51 |
children | 7c7432a53a6c |
rev | line source |
---|---|
651 | 1 " Vim filetype plugin file |
21991 | 2 " Language: Javascript |
3 " Maintainer: Doug Kearns <dougkearns@gmail.com> | |
4 " Contributor: Romain Lafourcade <romainlafourcade@gmail.com> | |
34134
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
21991
diff
changeset
|
5 " Last Change: 2024 Jan 14 |
651 | 6 |
7 if exists("b:did_ftplugin") | |
21991 | 8 finish |
651 | 9 endif |
10 let b:did_ftplugin = 1 | |
11 | |
1125 | 12 let s:cpo_save = &cpo |
13 set cpo-=C | |
14 | |
15 " Set 'formatoptions' to break comment lines but not other lines, | |
21991 | 16 " and insert the comment leader when hitting <CR> or using "o". |
1125 | 17 setlocal formatoptions-=t formatoptions+=croql |
18 | |
19 " Set completion with CTRL-X CTRL-O to autoloaded function. | |
651 | 20 if exists('&ofu') |
1125 | 21 setlocal omnifunc=javascriptcomplete#CompleteJS |
651 | 22 endif |
1125 | 23 |
24 " Set 'comments' to format dashed lists in comments. | |
25 setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// | |
26 | |
27 setlocal commentstring=//%s | |
28 | |
21991 | 29 " Change the :browse e filter to primarily show JavaScript-related files. |
30 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") | |
31 let b:browsefilter = | |
32 \ "JavaScript Files (*.js)\t*.js\n" | |
33 \ .. "JSX Files (*.jsx)\t*.jsx\n" | |
34 \ .. "JavaScript Modules (*.es, *.es6, *.cjs, *.mjs, *.jsm)\t*.es;*.es6;*.cjs;*.mjs;*.jsm\n" | |
35 \ .. "Vue Templates (*.vue)\t*.vue\n" | |
36 \ .. "JSON Files (*.json)\t*.json\n" | |
34134
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
21991
diff
changeset
|
37 if has("win32") |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
21991
diff
changeset
|
38 let b:browsefilter ..= "All Files (*.*)\t*\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
21991
diff
changeset
|
39 else |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
21991
diff
changeset
|
40 let b:browsefilter ..= "All Files (*)\t*\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
21991
diff
changeset
|
41 endif |
1125 | 42 endif |
21991 | 43 |
44 " The following suffixes should be implied when resolving filenames | |
45 setlocal suffixesadd+=.js,.jsx,.es,.es6,.cjs,.mjs,.jsm,.vue,.json | |
46 | |
47 " The following suffixes should have low priority | |
48 " .snap jest snapshot | |
49 setlocal suffixes+=.snap | |
50 | |
51 " Remove irrelevant part of 'path'. | |
52 " User is expected to augment it with contextually-relevant paths | |
53 setlocal path-=/usr/include | |
54 | |
55 " Matchit configuration | |
56 if exists("loaded_matchit") | |
57 let b:match_ignorecase = 0 | |
58 let b:match_words = | |
59 \ '\<do\>:\<while\>,' | |
60 \ .. '<\@<=\([^ \t>/]\+\)\%(\s\+[^>]*\%([^/]>\|$\)\|>\|$\):<\@<=/\1>,' | |
61 \ .. '<\@<=\%([^ \t>/]\+\)\%(\s\+[^/>]*\|$\):/>' | |
62 endif | |
63 | |
64 " Set 'define' to a comprehensive value | |
65 let &l:define = | |
66 \ '\(^\s*(*async\s\+function\|(*function\)' | |
67 \ .. '\|^\s*\(\*\|static\|async\|get\|set\|\i\+\.\)' | |
68 \ .. '\|^\s*\(\ze\i\+\)\(([^)]*).*{$\|\s*[:=,]\)' | |
69 \ .. '\|^\s*\(export\s\+\|export\s\+default\s\+\)*\(var\|let\|const\|function\|class\)' | |
70 \ .. '\|\<as\>' | |
71 | |
72 let b:undo_ftplugin = | |
73 \ "setl fo< ofu< com< cms< sua< su< def< pa<" | |
74 \ .. "| unlet! b:browsefilter b:match_ignorecase b:match_words" | |
1125 | 75 |
76 let &cpo = s:cpo_save | |
77 unlet s:cpo_save | |
21991 | 78 |
79 " vim: textwidth=78 tabstop=8 shiftwidth=4 softtabstop=4 expandtab |