From 7ed69660237bd052d11af454503a986c22c507a7 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 15 Jan 2024 11:12:32 +0100 Subject: vim-patch:93197fde0f1d 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 vim/vim#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: vim/vim#12759 https://github.com/vim/vim/commit/93197fde0f1db09b1e495cf3eb14a8f42c318b80 Co-authored-by: Doug Kearns --- runtime/ftplugin/falcon.vim | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'runtime/ftplugin/falcon.vim') diff --git a/runtime/ftplugin/falcon.vim b/runtime/ftplugin/falcon.vim index affca38481..1000b62e76 100644 --- a/runtime/ftplugin/falcon.vim +++ b/runtime/ftplugin/falcon.vim @@ -4,6 +4,7 @@ " Copyright: Copyright (c) 2009-2013 Steven Oliver " License: You may redistribute this under the same terms as Vim itself " Last Update: 2020 Oct 10 +" 2024 Jan 14 by Vim Project (browsefilter) " -------------------------------------------------------------------------- " Only do this when not done yet for this buffer @@ -34,14 +35,18 @@ endif setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// " Windows allows you to filter the open file dialog -if has("gui_win32") && !exists("b:browsefilter") - let b:browsefilter = "Falcon Source Files (*.fal *.ftd)\t*.fal;*.ftd\n" . - \ "All Files (*.*)\t*.*\n" +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "Falcon Source Files (*.fal, *.ftd)\t*.fal;*.ftd\n" + if has("win32") + let b:browsefilter ..= "All Files (*.*)\t*\n" + else + let b:browsefilter ..= "All Files (*)\t*\n" + endif endif let b:undo_ftplugin = "setlocal tabstop< shiftwidth< expandtab< fileencoding<" \ . " suffixesadd< comments<" - \ . "| unlet! b:browsefiler" + \ . "| unlet! b:browsefilter" let &cpo = s:cpo_save unlet s:cpo_save -- cgit