Mercurial > vim
annotate runtime/ftplugin/tcsh.vim @ 34134:8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Commit: https://github.com/vim/vim/commit/93197fde0f1db09b1e495cf3eb14a8f42c318b80
Author: Doug Kearns <dougkearns@gmail.com>
Date: Sun Jan 14 20:59:02 2024 +0100
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Problem: The "*.*" browsefilter pattern only matches all files on
Windows (Daryl Lee)
Solution: Use "*" to filter on all platforms but keep "*.*" as the label
text on Windows. (Fixes #12685, Doug Kearns)
The *.* browsefilter pattern used to match "All Files" on Windows is a
legacy of the DOS 8.3 filename wildcard matching algorithm. For reasons
of backward compatibility this still works on Windows to match all
files, even those without an extension.
However, this pattern only matches filenames containing a dot on other
platforms. This often makes files without an extension difficult to
access from the file dialog, e.g., "Makefile"
On Windows it is still standard practice to use "*.*" for the filter
label so ftplugins should use "All Files (*.*)" on Windows and "All
Files (*)" on other platforms. This matches Vim's default browsefilter
values.
This commit also normalises the browsefilter conditional test to check
for the Win32 and GTK GUI features and an unset b:browsefilter.
closes: #12759
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 14 Jan 2024 21:15:03 +0100 |
parents | 09e8f7ac05e0 |
children |
rev | line source |
---|---|
7 | 1 " Vim filetype plugin file |
25973 | 2 " Language: tcsh |
3 " Maintainer: Doug Kearns <dougkearns@gmail.com> | |
28010 | 4 " Previous Maintainer: Dan Sharp |
34134
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33545
diff
changeset
|
5 " Last Change: 2024 Jan 14 |
7 | 6 |
33545
09e8f7ac05e0
runtime(tcsh): Update ftplugin (#13327)
Christian Brabandt <cb@256bit.org>
parents:
28010
diff
changeset
|
7 if exists("b:did_ftplugin") |
09e8f7ac05e0
runtime(tcsh): Update ftplugin (#13327)
Christian Brabandt <cb@256bit.org>
parents:
28010
diff
changeset
|
8 finish |
09e8f7ac05e0
runtime(tcsh): Update ftplugin (#13327)
Christian Brabandt <cb@256bit.org>
parents:
28010
diff
changeset
|
9 endif |
7 | 10 |
11 let s:save_cpo = &cpo | |
12 set cpo-=C | |
13 | |
14 " Define some defaults in case the included ftplugins don't set them. | |
15 let s:undo_ftplugin = "" | |
34134
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33545
diff
changeset
|
16 let s:browsefilter = "csh Files (*.csh)\t*.csh\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33545
diff
changeset
|
17 if has("win32") |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33545
diff
changeset
|
18 let s:browsefilter ..= "All Files (*.*)\t*\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33545
diff
changeset
|
19 else |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33545
diff
changeset
|
20 let s:browsefilter ..= "All Files (*)\t*\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33545
diff
changeset
|
21 endif |
7 | 22 |
23 runtime! ftplugin/csh.vim ftplugin/csh_*.vim ftplugin/csh/*.vim | |
24 let b:did_ftplugin = 1 | |
25 | |
26 " Override our defaults if these were set by an included ftplugin. | |
27 if exists("b:undo_ftplugin") | |
33545
09e8f7ac05e0
runtime(tcsh): Update ftplugin (#13327)
Christian Brabandt <cb@256bit.org>
parents:
28010
diff
changeset
|
28 let s:undo_ftplugin = b:undo_ftplugin |
7 | 29 endif |
30 if exists("b:browsefilter") | |
33545
09e8f7ac05e0
runtime(tcsh): Update ftplugin (#13327)
Christian Brabandt <cb@256bit.org>
parents:
28010
diff
changeset
|
31 let s:browsefilter = b:browsefilter |
7 | 32 endif |
33 | |
33545
09e8f7ac05e0
runtime(tcsh): Update ftplugin (#13327)
Christian Brabandt <cb@256bit.org>
parents:
28010
diff
changeset
|
34 if (has("gui_win32") || has("gui_gtk")) && |
09e8f7ac05e0
runtime(tcsh): Update ftplugin (#13327)
Christian Brabandt <cb@256bit.org>
parents:
28010
diff
changeset
|
35 \ (!exists("b:browsefilter") || exists("b:csh_set_browsefilter")) |
09e8f7ac05e0
runtime(tcsh): Update ftplugin (#13327)
Christian Brabandt <cb@256bit.org>
parents:
28010
diff
changeset
|
36 let b:browsefilter = "tcsh Scripts (*.tcsh)\t*.tcsh\n" .. s:browsefilter |
09e8f7ac05e0
runtime(tcsh): Update ftplugin (#13327)
Christian Brabandt <cb@256bit.org>
parents:
28010
diff
changeset
|
37 let s:undo_ftplugin = "unlet! b:browsefilter | " .. s:undo_ftplugin |
7 | 38 endif |
39 | |
33545
09e8f7ac05e0
runtime(tcsh): Update ftplugin (#13327)
Christian Brabandt <cb@256bit.org>
parents:
28010
diff
changeset
|
40 let b:undo_ftplugin = s:undo_ftplugin |
7 | 41 |
42 let &cpo = s:save_cpo | |
3410
94601b379f38
Updated runtime files. Add Dutch translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
43 unlet s:save_cpo |