annotate runtime/ftplugin/config.vim @ 34684:faf891660963 v9.1.0223

patch 9.1.0223: code duplication in loop to add active text properties Commit: https://github.com/vim/vim/commit/1134fdd1b369119d0d6992e3120bb5f7c788b697 Author: Dylan Thacker-Smith <dylan.ah.smith@gmail.com> Date: Thu Mar 28 11:49:46 2024 +0100 patch 9.1.0223: code duplication in loop to add active text properties Problem: There are two dense conditions with duplication that needs to be kept in sync between the while loop break condition and the condition to skip certain text properties. Solution: Refactor the loop by moving while loop conditions into the body of the while loop so they can be shared with skip conditions. `break` and an `active` variable are used to handle the outcome of these merged conditions. (Dylan Thacker-Smith) closes: #14307 Signed-off-by: Dylan Thacker-Smith <dylan.ah.smith@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Thu, 28 Mar 2024 12:00:05 +0100
parents 8ae680be2a51
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim filetype plugin file
34134
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 28010
diff changeset
2 " Language: config
28010
c968191a8557 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 3410
diff changeset
3 "
c968191a8557 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 3410
diff changeset
4 " This runtime file is looking for a new maintainer.
c968191a8557 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 3410
diff changeset
5 "
c968191a8557 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 3410
diff changeset
6 " Former maintainer: Dan Sharp
34134
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 28010
diff changeset
7 " Last Change: 2009 Jan 20
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 28010
diff changeset
8 " 2024 Jan 14 by Vim Project (browsefilter)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 if exists("b:did_ftplugin") | finish | endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 " Make sure the continuation lines below do not cause problems in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 " compatibility mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 let s:save_cpo = &cpo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 set cpo-=C
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 " Define some defaults in case the included ftplugins don't set them.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 let s:undo_ftplugin = ""
34134
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 28010
diff changeset
19 let s:browsefilter = "Bourne Shell Files (*.sh)\t*.sh\n"
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 28010
diff changeset
20 if has("win32")
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 28010
diff changeset
21 let s:browsefilter .= "All Files (*.*)\t*\n"
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 28010
diff changeset
22 else
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 28010
diff changeset
23 let s:browsefilter .= "All Files (*)\t*\n"
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 28010
diff changeset
24 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 let s:match_words = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 runtime! ftplugin/sh.vim ftplugin/sh_*.vim ftplugin/sh/*.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 let b:did_ftplugin = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 " Override our defaults if these were set by an included ftplugin.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 if exists("b:undo_ftplugin")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 let s:undo_ftplugin = b:undo_ftplugin
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 if exists("b:browsefilter")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 let s:browsefilter = b:browsefilter
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 " Change the :browse e filter to primarily show configure-related files.
34134
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 28010
diff changeset
39 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
15
631143ac4a01 updated for version 7.0007
vimboss
parents: 7
diff changeset
40 let b:browsefilter="Configure Scripts (configure.*, config.*)\tconfigure*;config.*\n" .
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 \ s:browsefilter
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 " Undo the stuff we changed.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 let b:undo_ftplugin = "unlet! b:browsefilter | " . b:undo_ftplugin
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 " Restore the saved compatibility options.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 let &cpo = s:save_cpo
3410
94601b379f38 Updated runtime files. Add Dutch translations.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
49 unlet s:save_cpo