annotate runtime/ftplugin/forth.vim @ 34146:23bb675796f0 v9.1.0034

patch 9.1.0034: Window scrolls unexpectedly when 'scrollbind' is set Commit: https://github.com/vim/vim/commit/ac4cffc6d9d307778d8a2945adab70244470bbb8 Author: Christian Brabandt <cb@256bit.org> Date: Tue Jan 16 17:22:38 2024 +0100 patch 9.1.0034: Window scrolls unexpectedly when 'scrollbind' is set Problem: Window may unexpectedly scroll when 'scrollbind' is set and setting a buffer-local option using setbufvar() (Boris Staletic) Solution: Save and restore the windows topline before opening the popup window. fixes: #13863 closes: #13869 Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Tue, 16 Jan 2024 17:30:10 +0100
parents 8ae680be2a51
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
33081
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Vim filetype plugin
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2 " Language: Forth
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 " Maintainer: Johan Kotlinski <kotlinski@gmail.com>
33258
5b95bef071c0 runtime(forth): Fix :unlet error in ftplugin (#13090)
Christian Brabandt <cb@256bit.org>
parents: 33081
diff changeset
4 " Last Change: 2023 Sep 15
34134
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 33258
diff changeset
5 " 2024 Jan 14 by Vim Project (browsefilter)
33081
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 " URL: https://github.com/jkotlinski/forth.vim
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 if exists("b:did_ftplugin")
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 finish
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 endif
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 let b:did_ftplugin = 1
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 let s:cpo_save = &cpo
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 set cpo&vim
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 setlocal commentstring=\\\ %s
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 setlocal comments=s:(,mb:\ ,e:),b:\\
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 setlocal iskeyword=33-126,128-255
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 let s:include_patterns =<< trim EOL
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 \<\%(INCLUDE\|REQUIRE\)\>\s\+\zs\k\+\ze
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 \<S"\s\+\zs[^"]*\ze"\s\+\%(INCLUDED\|REQUIRED\)\>
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 EOL
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 let &l:include = $'\c{ s:include_patterns[1:]->join('\|') }'
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 let s:define_patterns =<< trim EOL
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 :
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 [2F]\=CONSTANT
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 [2F]\=VALUE
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 [2F]\=VARIABLE
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 BEGIN-STRUCTURE
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33 BUFFER:
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 CODE
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 CREATE
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36 MARKER
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37 SYNONYM
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 EOL
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39 let &l:define = $'\c\<\%({ s:define_patterns->join('\|') }\)'
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
40
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
41 " assume consistent intra-project file extensions
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
42 let &l:suffixesadd = "." .. expand("%:e")
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
43
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
44 let b:undo_ftplugin = "setl cms< com< def< inc< isk< sua<"
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
45
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
46 if exists("loaded_matchit") && !exists("b:match_words")
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
47 let s:matchit_patterns =<< trim EOL
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
48
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
49 \<\:\%(NONAME\)\=\>:\<EXIT\>:\<;\>
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
50 \<IF\>:\<ELSE\>:\<THEN\>
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
51 \<\[IF]\>:\<\[ELSE]\>:\<\[THEN]\>
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
52 \<?\=DO\>:\<LEAVE\>:\<+\=LOOP\>
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
53 \<CASE\>:\<ENDCASE\>
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
54 \<OF\>:\<ENDOF\>
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
55 \<BEGIN\>:\<WHILE\>:\<\%(AGAIN\|REPEAT\|UNTIL\)\>
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
56 \<CODE\>:\<END-CODE\>
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
57 \<BEGIN-STRUCTURE\>:\<END-STRUCTURE\>
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
58 EOL
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
59 let b:match_ignorecase = 1
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
60 let b:match_words = s:matchit_patterns[1:]->join(',')
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
61 let b:undo_ftplugin ..= "| unlet! b:match_ignorecase b:match_words"
33258
5b95bef071c0 runtime(forth): Fix :unlet error in ftplugin (#13090)
Christian Brabandt <cb@256bit.org>
parents: 33081
diff changeset
62 unlet s:matchit_patterns
33081
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
63 endif
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
64
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
65 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
34134
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 33258
diff changeset
66 let b:browsefilter = "Forth Source Files (*.f, *.fs, *.ft, *.fth, *.4th)\t*.f;*.fs;*.ft;*.fth;*.4th\n"
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 33258
diff changeset
67 if has("win32")
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 33258
diff changeset
68 let b:browsefilter ..= "All Files (*.*)\t*\n"
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 33258
diff changeset
69 else
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 33258
diff changeset
70 let b:browsefilter ..= "All Files (*)\t*\n"
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 33258
diff changeset
71 endif
33081
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
72 let b:undo_ftplugin ..= " | unlet! b:browsefilter"
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
73 endif
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
74
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
75 let &cpo = s:cpo_save
1549d0cc5fc7 runtime(forth): Update syntax and ftplugin files (#12976)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
76 unlet s:cpo_save
33258
5b95bef071c0 runtime(forth): Fix :unlet error in ftplugin (#13090)
Christian Brabandt <cb@256bit.org>
parents: 33081
diff changeset
77 unlet s:define_patterns s:include_patterns