summaryrefslogtreecommitdiffstats
path: root/runtime/ftplugin
diff options
context:
space:
mode:
authorDoug Kearns <dougkearns@gmail.com>2024-01-14 20:59:02 +0100
committerChristian Brabandt <cb@256bit.org>2024-01-14 21:02:54 +0100
commit93197fde0f1db09b1e495cf3eb14a8f42c318b80 (patch)
tree1650d736f95a604255c854d25b93d85a8ed71e4a /runtime/ftplugin
parentd7d560374b836e62e180914b6e85f0eb20557a54 (diff)
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>
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r--runtime/ftplugin/aap.vim9
-rw-r--r--runtime/ftplugin/abap.vim15
-rw-r--r--runtime/ftplugin/abaqus.vim9
-rw-r--r--runtime/ftplugin/ant.vim15
-rw-r--r--runtime/ftplugin/aspvbs.vim15
-rw-r--r--runtime/ftplugin/awk.vim14
-rw-r--r--runtime/ftplugin/basic.vim10
-rw-r--r--runtime/ftplugin/c.vim32
-rw-r--r--runtime/ftplugin/clojure.vim9
-rw-r--r--runtime/ftplugin/cobol.vim9
-rw-r--r--runtime/ftplugin/config.vim15
-rw-r--r--runtime/ftplugin/cs.vim11
-rw-r--r--runtime/ftplugin/csh.vim10
-rw-r--r--runtime/ftplugin/diff.vim9
-rw-r--r--runtime/ftplugin/dosbatch.vim12
-rw-r--r--runtime/ftplugin/dtd.vim15
-rw-r--r--runtime/ftplugin/eiffel.vim10
-rw-r--r--runtime/ftplugin/eruby.vim11
-rw-r--r--runtime/ftplugin/expect.vim10
-rw-r--r--runtime/ftplugin/falcon.vim13
-rw-r--r--runtime/ftplugin/forth.vim9
-rw-r--r--runtime/ftplugin/fortran.vim10
-rw-r--r--runtime/ftplugin/fpcmake.vim12
-rw-r--r--runtime/ftplugin/freebasic.vim10
-rw-r--r--runtime/ftplugin/haml.vim15
-rw-r--r--runtime/ftplugin/html.vim12
-rw-r--r--runtime/ftplugin/icon.vim16
-rw-r--r--runtime/ftplugin/ishd.vim10
-rw-r--r--runtime/ftplugin/j.vim7
-rw-r--r--runtime/ftplugin/java.vim15
-rw-r--r--runtime/ftplugin/javascript.vim8
-rw-r--r--runtime/ftplugin/json5.vim10
-rw-r--r--runtime/ftplugin/jsp.vim15
-rw-r--r--runtime/ftplugin/kotlin.vim10
-rw-r--r--runtime/ftplugin/kwt.vim15
-rw-r--r--runtime/ftplugin/lua.vim10
-rw-r--r--runtime/ftplugin/lynx.vim10
-rw-r--r--runtime/ftplugin/m3build.vim10
-rw-r--r--runtime/ftplugin/m3quake.vim10
-rw-r--r--runtime/ftplugin/meson.vim9
-rw-r--r--runtime/ftplugin/mf.vim7
-rw-r--r--runtime/ftplugin/modula2.vim10
-rw-r--r--runtime/ftplugin/modula3.vim10
-rw-r--r--runtime/ftplugin/mp.vim7
-rw-r--r--runtime/ftplugin/msmessages.vim13
-rw-r--r--runtime/ftplugin/occam.vim17
-rw-r--r--runtime/ftplugin/octave.vim10
-rw-r--r--runtime/ftplugin/pascal.vim10
-rw-r--r--runtime/ftplugin/perl.vim9
-rw-r--r--runtime/ftplugin/php.vim10
-rw-r--r--runtime/ftplugin/pod.vim10
-rw-r--r--runtime/ftplugin/poke.vim16
-rw-r--r--runtime/ftplugin/postscr.vim15
-rw-r--r--runtime/ftplugin/ps1.vim13
-rw-r--r--runtime/ftplugin/ps1xml.vim13
-rw-r--r--runtime/ftplugin/pyrex.vim13
-rw-r--r--runtime/ftplugin/python.vim9
-rw-r--r--runtime/ftplugin/qml.vim12
-rw-r--r--runtime/ftplugin/r.vim9
-rw-r--r--runtime/ftplugin/racket.vim9
-rw-r--r--runtime/ftplugin/readline.vim10
-rw-r--r--runtime/ftplugin/registry.vim15
-rw-r--r--runtime/ftplugin/rhelp.vim9
-rw-r--r--runtime/ftplugin/rmd.vim9
-rw-r--r--runtime/ftplugin/rnoweb.vim9
-rw-r--r--runtime/ftplugin/routeros.vim9
-rw-r--r--runtime/ftplugin/rrst.vim9
-rw-r--r--runtime/ftplugin/ruby.vim9
-rw-r--r--runtime/ftplugin/sed.vim10
-rw-r--r--runtime/ftplugin/sgml.vim15
-rw-r--r--runtime/ftplugin/sh.vim14
-rw-r--r--runtime/ftplugin/solution.vim10
-rw-r--r--runtime/ftplugin/sql.vim13
-rw-r--r--runtime/ftplugin/svg.vim15
-rw-r--r--runtime/ftplugin/tcl.vim13
-rw-r--r--runtime/ftplugin/tcsh.vim10
-rw-r--r--runtime/ftplugin/tidy.vim16
-rw-r--r--runtime/ftplugin/typescript.vim15
-rw-r--r--runtime/ftplugin/vb.vim10
-rw-r--r--runtime/ftplugin/verilog.vim13
-rw-r--r--runtime/ftplugin/vhdl.vim14
-rw-r--r--runtime/ftplugin/wget.vim10
-rw-r--r--runtime/ftplugin/wget2.vim10
-rw-r--r--runtime/ftplugin/xhtml.vim15
-rw-r--r--runtime/ftplugin/xml.vim9
-rw-r--r--runtime/ftplugin/xsd.vim15
-rw-r--r--runtime/ftplugin/xslt.vim2
87 files changed, 701 insertions, 305 deletions
diff --git a/runtime/ftplugin/aap.vim b/runtime/ftplugin/aap.vim
index df839c99ae..cd7e2a425e 100644
--- a/runtime/ftplugin/aap.vim
+++ b/runtime/ftplugin/aap.vim
@@ -1,7 +1,7 @@
" Vim filetype plugin file
" Language: Aap recipe
" Maintainer: The Vim Project <https://github.com/vim/vim>
-" Last Change: 2023 Aug 10
+" Last Change: 2024 Jan 14
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
" Only do this when not done yet for this buffer
@@ -28,6 +28,11 @@ setlocal commentstring=#\ %s
setlocal expandtab
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
- let b:browsefilter = "Aap Recipe Files (*.aap)\t*.aap\nAll Files (*.*)\t*.*\n"
+ let b:browsefilter = "Aap Recipe Files (*.aap)\t*.aap\n"
+ if has("win32")
+ let b:browsefilter ..= "All Files (*.*)\t*\n"
+ else
+ let b:browsefilter ..= "All Files (*)\t*\n"
+ endif
let b:undo_ftplugin ..= " | unlet! b:browsefilter"
endif
diff --git a/runtime/ftplugin/abap.vim b/runtime/ftplugin/abap.vim
index 61db8093fb..8b2040e5aa 100644
--- a/runtime/ftplugin/abap.vim
+++ b/runtime/ftplugin/abap.vim
@@ -3,7 +3,8 @@
" Author: Steven Oliver <oliver.steven@gmail.com>
" Copyright: Copyright (c) 2013 Steven Oliver
" License: You may redistribute this under the same terms as Vim itself
-" Last Change: 2023 Aug 28 by Vim Project (undo_ftplugin)
+" Last Change: 2023 Aug 28 by Vim Project (undo_ftplugin)
+" 2024 Jan 14 by Vim Project (browsefilter)
" --------------------------------------------------------------------------
" Only do this when not done yet for this buffer
@@ -21,10 +22,14 @@ setlocal suffixesadd=.abap
let b:undo_ftplugin = "setl sts< sua< sw<"
" Windows allows you to filter the open file dialog
-if has("gui_win32") && !exists("b:browsefilter")
- let b:browsefilter = "ABAP Source Files (*.abap)\t*.abap\n" .
- \ "All Files (*.*)\t*.*\n"
- let b:undo_ftplugin .= " | unlet! b:browsefilter"
+if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
+ let b:browsefilter = "ABAP Source Files (*.abap)\t*.abap\n"
+ if has("win32")
+ let b:browsefilter ..= "All Files (*.*)\t*\n"
+ else
+ let b:browsefilter ..= "All Files (*)\t*\n"
+ endif
+ let b:undo_ftplugin ..= " | unlet! b:browsefilter"
endif
let &cpo = s:cpo_save
diff --git a/runtime/ftplugin/abaqus.vim b/runtime/ftplugin/abaqus.vim
index 5931cd921d..c16e7b032e 100644
--- a/runtime/ftplugin/abaqus.vim
+++ b/runtime/ftplugin/abaqus.vim
@@ -2,6 +2,7 @@
" Language: Abaqus finite element input file (www.abaqus.com)
" Maintainer: Carl Osterwisch <costerwi@gmail.com>
" Last Change: 2022 Oct 08
+" 2024 Jan 14 by Vim Project (browsefilter)
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin") | finish | endif
@@ -49,8 +50,12 @@ endif
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
let b:browsefilter = "Abaqus Input Files (*.inp *.inc)\t*.inp;*.inc\n" .
\ "Abaqus Results (*.dat)\t*.dat\n" .
- \ "Abaqus Messages (*.pre *.msg *.sta)\t*.pre;*.msg;*.sta\n" .
- \ "All Files (*.*)\t*.*\n"
+ \ "Abaqus Messages (*.pre, *.msg, *.sta)\t*.pre;*.msg;*.sta\n"
+ if has("win32")
+ let b:browsefilter .= "All Files (*.*)\t*\n"
+ else
+ let b:browsefilter .= "All Files (*)\t*\n"
+ endif
let b:undo_ftplugin .= "|unlet! b:browsefilter"
endif
diff --git a/runtime/ftplugin/ant.vim b/runtime/ftplugin/ant.vim
index aee07ca4b9..65e01a1a76 100644
--- a/runtime/ftplugin/ant.vim
+++ b/runtime/ftplugin/ant.vim
@@ -1,10 +1,11 @@
" Vim filetype plugin file
-" Language: ant
+" Language: ant
"
" This runtime file is looking for a new maintainer.
"
" Former maintainer: Dan Sharp
-" Last Changed: 20 Jan 2009
+" Last Change: 2009 Jan 20
+" 2024 Jan 14 by Vim Project (browsefilter)
if exists("b:did_ftplugin") | finish | endif
@@ -15,8 +16,12 @@ set cpo-=C
" Define some defaults in case the included ftplugins don't set them.
let s:undo_ftplugin = ""
-let s:browsefilter = "XML Files (*.xml)\t*.xml\n" .
- \ "All Files (*.*)\t*.*\n"
+let s:browsefilter = "XML Files (*.xml)\t*.xml\n"
+if has("win32")
+ let s:browsefilter .= "All Files (*.*)\t*\n"
+else
+ let s:browsefilter .= "All Files (*)\t*\n"
+endif
runtime! ftplugin/xml.vim ftplugin/xml_*.vim ftplugin/xml/*.vim
let b:did_ftplugin = 1
@@ -30,7 +35,7 @@ if exists("b:browsefilter")
endif
" Change the :browse e filter to primarily show Ant-related files.
-if has("gui_win32")
+if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
let b:browsefilter = "Build Files (build.xml)\tbuild.xml\n" .
\ "Java Files (*.java)\t*.java\n" .
\ "Properties Files (*.prop*)\t*.prop*\n" .
diff --git a/runtime/ftplugin/aspvbs.vim b/runtime/ftplugin/aspvbs.vim
index 70a130d287..6979bb8f84 100644
--- a/runtime/ftplugin/aspvbs.vim
+++ b/runtime/ftplugin/aspvbs.vim
@@ -1,10 +1,11 @@
" Vim filetype plugin file
-" Language: aspvbs
+" Language: aspvbs
"
" This runtime file is looking for a new maintainer.
"
" Former maintainer: Dan Sharp
-" Last Changed: 20 Jan 2009
+" Last Change: 2009 Jan 20
+" 2024 Jan 14 by Vim Project (browsefilter)
if exists("b:did_ftplugin") | finish | endif
@@ -15,8 +16,12 @@ set cpo-=C
" Define some defaults in case the included ftplugins don't set them.
let s:undo_ftplugin = ""
-let s:browsefilter = "HTML Files (*.html, *.htm)\t*.htm*\n" .
- \ "All Files (*.*)\t*.*\n"
+let s:browsefilter = "HTML Files (*.html, *.htm)\t*.htm*\n"
+if has("win32")
+ let s:browsefilter .= "All Files (*.*)\t*\n"
+else
+ let s:browsefilter .= "All Files (*)\t*\n"
+endif
let s:match_words = ""
runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
@@ -51,7 +56,7 @@ if exists("loaded_matchit")
endif
" Change the :browse e filter to primarily show ASP-related files.
-if has("gui_win32")
+if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
let b:browsefilter="ASP Files (*.asp)\t*.asp\n" . s:browsefilter
endif
diff --git a/runtime/ftplugin/awk.vim b/runtime/ftplugin/awk.vim
index 40fe304cf4..bcd772350a 100644
--- a/runtime/ftplugin/awk.vim
+++ b/runtime/ftplugin/awk.vim
@@ -2,7 +2,7 @@
" Language: awk, nawk, gawk, mawk
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Previous Maintainer: Antonio Colombo <azc100@gmail.com>
-" Last Change: 2020 Sep 28
+" Last Change: 2024 Jan 14
" This plugin was prepared by Mark Sikora
" This plugin was updated as proposed by Doug Kearns
@@ -25,8 +25,7 @@ setlocal formatoptions-=t formatoptions+=croql
setlocal define=function
setlocal suffixesadd+=.awk
-let b:undo_ftplugin = "setl fo< com< cms< def< sua<" .
- \ " | unlet! b:browsefilter"
+let b:undo_ftplugin = "setl fo< com< cms< def< sua<"
" TODO: set this in scripts.vim?
if exists("g:awk_is_gawk")
@@ -49,8 +48,13 @@ if exists("g:awk_is_gawk")
endif
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
- let b:browsefilter = "Awk Source Files (*.awk,*.gawk)\t*.awk;*.gawk\n" .
- \ "All Files (*.*)\t*.*\n"
+ let b:browsefilter = "Awk Source Files (*.awk, *.gawk)\t*.awk;*.gawk\n"
+ if has("win32")
+ let b:browsefilter .= "All Files (*.*)\t*\n"
+ else
+ let b:browsefilter .= "All Files (*)\t*\n"
+ endif
+ let b:undo_ftplugin .= " | unlet! b:browsefilter"
endif
let &cpo = s:cpo_save
diff --git a/runtime/ftplugin/basic.vim b/runtime/ftplugin/basic.vim
index 4399fbf3ad..32f713b43e 100644
--- a/runtime/ftplugin/basic.vim
+++ b/runtime/ftplugin/basic.vim
@@ -1,7 +1,7 @@
" Vim filetype plugin file
" Language: BASIC (QuickBASIC 4.5)
" Maintainer: Doug Kearns <dougkearns@gmail.com>
-" Last Change: 2022 Jun 22
+" Last Change: 2024 Jan 14
if exists("b:did_ftplugin")
finish
@@ -45,8 +45,12 @@ endif
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
let b:browsefilter = "BASIC Source Files (*.bas)\t*.bas\n" ..
- \ "BASIC Include Files (*.bi, *.bm)\t*.bi;*.bm\n" ..
- \ "All Files (*.*)\t*.*\n"
+ \ "BASIC Include Files (*.bi, *.bm)\t*.bi;*.bm\n"
+ if has("win32")
+ let b:browsefilter ..= "All Files (*.*)\t*\n"
+ else
+ let b:browsefilter ..= "All Files (*)\t*\n"
+ endif
let b:basic_set_browsefilter = 1
let b:undo_ftplugin ..= " | unlet! b:browsefilter b:basic_set_browsefilter"
endif
diff --git a/runtime/ftplugin/c.vim b/runtime/ftplugin/c.vim
index 4ddc4a5392..e2eebc5492 100644
--- a/runtime/ftplugin/c.vim
+++ b/runtime/ftplugin/c.vim
@@ -1,7 +1,7 @@
" Vim filetype plugin file
" Language: C
" Maintainer: The Vim Project <https://github.com/vim/vim>
-" Last Change: 2023 Aug 10
+" Last Change: 2023 Aug 22
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
" Only do this when not done yet for this buffer
@@ -48,24 +48,26 @@ if !exists("b:match_words")
let b:undo_ftplugin ..= " | unlet! b:match_skip b:match_words"
endif
-" Win32 can filter files in the browse dialog
+" Win32 and GTK can filter files in the browse dialog
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
if &ft == "cpp"
- let b:browsefilter = "C++ Source Files (*.cpp *.c++)\t*.cpp;*.c++\n" .
- \ "C Header Files (*.h)\t*.h\n" .
- \ "C Source Files (*.c)\t*.c\n" .
- \ "All Files (*.*)\t*.*\n"
+ let b:browsefilter = "C++ Source Files (*.cpp, *.c++)\t*.cpp;*.c++\n" ..
+ \ "C Header Files (*.h)\t*.h\n" ..
+ \ "C Source Files (*.c)\t*.c\n"
elseif &ft == "ch"
- let b:browsefilter = "Ch Source Files (*.ch *.chf)\t*.ch;*.chf\n" .
- \ "C Header Files (*.h)\t*.h\n" .
- \ "C Source Files (*.c)\t*.c\n" .
- \ "All Files (*.*)\t*.*\n"
+ let b:browsefilter = "Ch Source Files (*.ch, *.chf)\t*.ch;*.chf\n" ..
+ \ "C Header Files (*.h)\t*.h\n" ..
+ \ "C Source Files (*.c)\t*.c\n"
else
- let b:browsefilter = "C Source Files (*.c)\t*.c\n" .
- \ "C Header Files (*.h)\t*.h\n" .
- \ "Ch Source Files (*.ch *.chf)\t*.ch;*.chf\n" .
- \ "C++ Source Files (*.cpp *.c++)\t*.cpp;*.c++\n" .
- \ "All Files (*.*)\t*.*\n"
+ let b:browsefilter = "C Source Files (*.c)\t*.c\n" ..
+ \ "C Header Files (*.h)\t*.h\n" ..
+ \ "Ch Source Files (*.ch, *.chf)\t*.ch;*.chf\n" ..
+ \ "C++ Source Files (*.cpp, *.c++)\t*.cpp;*.c++\n"
+ endif
+ if has("win32")
+ let b:browsefilter ..= "All Files (*.*)\t*\n"
+ else
+ let b:browsefilter ..= "All Files (*)\t*\n"
endif
let b:undo_ftplugin ..= " | unlet! b:browsefilter"
endif
diff --git a/runtime/ftplugin/clojure.vim b/runtime/ftplugin/clojure.vim
index c922d75699..4da7554d85 100644
--- a/runtime/ftplugin/clojure.vim
+++ b/runtime/ftplugin/clojure.vim
@@ -6,6 +6,7 @@
" URL: https://github.com/clojure-vim/clojure.vim
" License: Vim (see :h license)
" Last Change: 2022-03-24
+" 2024 Jan 14 by Vim Project (browsefilter)
if exists("b:did_ftplugin")
finish
@@ -66,10 +67,14 @@ endif
" Filter files in the browse dialog
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
- let b:browsefilter = "All Files\t*\n" .
- \ "Clojure Files\t*.clj;*.cljc;*.cljs;*.cljx\n" .
+ let b:browsefilter = "Clojure Files\t*.clj;*.cljc;*.cljs;*.cljx\n" .
\ "EDN Files\t*.edn\n" .
\ "Java Files\t*.java\n"
+ if has("win32")
+ let b:browsefilter .= "All Files (*.*)\t*\n"
+ else
+ let b:browsefilter .= "All Files (*)\t*\n"
+ endif
let b:undo_ftplugin .= ' | unlet! b:browsefilter'
endif
diff --git a/runtime/ftplugin/cobol.vim b/runtime/ftplugin/cobol.vim
index ec1e95456d..5e52702fd5 100644
--- a/runtime/ftplugin/cobol.vim
+++ b/runtime/ftplugin/cobol.vim
@@ -3,6 +3,7 @@
" Maintainer: Ankit Jain <ajatkj@yahoo.co.in>
" (formerly Tim Pope <vimNOSPAM@tpope.info>)
" Last Update: By Ankit Jain (add gtk support) on 15.08.2020
+" 2024 Jan 14 by Vim Project (browsefilter)
" Insert mode mappings: <C-T> <C-D> <Tab>
" Normal mode mappings: < > << >> [[ ]] [] ][
@@ -39,8 +40,12 @@ endif
" add gtk support
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
- let b:browsefilter = "COBOL Source Files (*.cbl, *.cob)\t*.c