Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
34133:c6737e875c4a | 34134:8ae680be2a51 |
---|---|
1 " Vim filetype plugin file | 1 " Vim filetype plugin file |
2 " Language: tcsh | 2 " Language: tcsh |
3 " Maintainer: Doug Kearns <dougkearns@gmail.com> | 3 " Maintainer: Doug Kearns <dougkearns@gmail.com> |
4 " Previous Maintainer: Dan Sharp | 4 " Previous Maintainer: Dan Sharp |
5 " Last Change: 2023 Oct 09 | 5 " Last Change: 2024 Jan 14 |
6 | 6 |
7 if exists("b:did_ftplugin") | 7 if exists("b:did_ftplugin") |
8 finish | 8 finish |
9 endif | 9 endif |
10 | 10 |
11 let s:save_cpo = &cpo | 11 let s:save_cpo = &cpo |
12 set cpo-=C | 12 set cpo-=C |
13 | 13 |
14 " Define some defaults in case the included ftplugins don't set them. | 14 " Define some defaults in case the included ftplugins don't set them. |
15 let s:undo_ftplugin = "" | 15 let s:undo_ftplugin = "" |
16 let s:browsefilter = "csh Files (*.csh)\t*.csh\n" .. | 16 let s:browsefilter = "csh Files (*.csh)\t*.csh\n" |
17 \ "All Files (*.*)\t*.*\n" | 17 if has("win32") |
18 let s:browsefilter ..= "All Files (*.*)\t*\n" | |
19 else | |
20 let s:browsefilter ..= "All Files (*)\t*\n" | |
21 endif | |
18 | 22 |
19 runtime! ftplugin/csh.vim ftplugin/csh_*.vim ftplugin/csh/*.vim | 23 runtime! ftplugin/csh.vim ftplugin/csh_*.vim ftplugin/csh/*.vim |
20 let b:did_ftplugin = 1 | 24 let b:did_ftplugin = 1 |
21 | 25 |
22 " Override our defaults if these were set by an included ftplugin. | 26 " Override our defaults if these were set by an included ftplugin. |