annotate runtime/ftplugin/tcl.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 94601b379f38
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
1 " Vim filetype plugin file
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
2 " Language: Tcl
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
3 " Maintainer: Robert L Hicks <sigzero@gmail.com>
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
4 " Latest Revision: 2009-05-01
34134
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 3410
diff changeset
5 " 2024 Jan 14 by Vim Project (browsefilter)
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
6
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
7 if exists("b:did_ftplugin")
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
8 finish
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
9 endif
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
10 let b:did_ftplugin = 1
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
11
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
12 " Make sure the continuation lines below do not cause problems in
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
13 " compatibility mode.
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
14 let s:cpo_save = &cpo
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
15 set cpo-=C
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
16
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
17 setlocal comments=:#
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
18 setlocal commentstring=#%s
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
19 setlocal formatoptions+=croql
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
20
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
21 " Change the browse dialog on Windows to show mainly Tcl-related files
34134
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 3410
diff changeset
22 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 3410
diff changeset
23 let b:browsefilter = "Tcl Source Files (*.tcl)\t*.tcl\n" .
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 3410
diff changeset
24 \ "Tcl Test Files (*.test)\t*.test\n"
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 3410
diff changeset
25 if has("win32")
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 3410
diff changeset
26 let b:browsefilter .= "All Files (*.*)\t*\n"
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 3410
diff changeset
27 else
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 3410
diff changeset
28 let b:browsefilter .= "All Files (*)\t*\n"
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 3410
diff changeset
29 endif
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
30 endif
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
31
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
32 "-----------------------------------------------------------------------------
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
33
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
34 " Undo the stuff we changed.
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
35 let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isf< kp<" .
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
36 \ " | unlet! b:browsefilter"
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
37
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
38 " Restore the saved compatibility options.
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
39 let &cpo = s:cpo_save
3410
94601b379f38 Updated runtime files. Add Dutch translations.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
40 unlet s:cpo_save
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
41
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
42 " vim: set et ts=4 sw=4 tw=78: