Mercurial > vim
annotate runtime/ftplugin/erlang.vim @ 33636:53416c49a7ab v9.0.2059
patch 9.0.2059: outstanding exceptions may be skipped
Commit: https://github.com/vim/vim/commit/0ab500dede4edd8d5aee7ddc63444537be527871
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Sat Oct 21 11:59:42 2023 +0200
patch 9.0.2059: outstanding exceptions may be skipped
Problem: outstanding exceptions may be skipped
Solution: When restoring exception state, process remaining outstanding
exceptions
closes: #13386
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 21 Oct 2023 12:15:03 +0200 |
parents | f68f43043842 |
children | f5c639a69421 |
rev | line source |
---|---|
3281 | 1 " Vim ftplugin file |
23573 | 2 " Language: Erlang (http://www.erlang.org) |
3 " Maintainer: Csaba Hoch <csaba.hoch@gmail.com> | |
22723 | 4 " Author: Oscar Hellström <oscar@oscarh.net> |
5 " Contributors: Ricardo Catalinas Jiménez <jimenezrick@gmail.com> | |
3281 | 6 " Eduardo Lopez (http://github.com/tapichu) |
23573 | 7 " Arvid Bjurklint (http://github.com/slarwise) |
30634 | 8 " Last Update: 2021-Nov-22 |
3281 | 9 " License: Vim license |
23573 | 10 " URL: https://github.com/vim-erlang/vim-erlang-runtime |
3281 | 11 |
12 if exists('b:did_ftplugin') | |
23573 | 13 finish |
3281 | 14 endif |
23573 | 15 let b:did_ftplugin = 1 |
3281 | 16 |
3410
94601b379f38
Updated runtime files. Add Dutch translations.
Bram Moolenaar <bram@vim.org>
parents:
3356
diff
changeset
|
17 let s:cpo_save = &cpo |
94601b379f38
Updated runtime files. Add Dutch translations.
Bram Moolenaar <bram@vim.org>
parents:
3356
diff
changeset
|
18 set cpo&vim |
94601b379f38
Updated runtime files. Add Dutch translations.
Bram Moolenaar <bram@vim.org>
parents:
3356
diff
changeset
|
19 |
23573 | 20 let &l:keywordprg = get(g:, 'erlang_keywordprg', 'erl -man') |
21 | |
22 if get(g:, 'erlang_folding', 0) | |
23 setlocal foldmethod=expr | |
24 setlocal foldexpr=GetErlangFold(v:lnum) | |
25 setlocal foldtext=ErlangFoldText() | |
3281 | 26 endif |
27 | |
23573 | 28 setlocal comments=:%%%,:%%,:% |
29 setlocal commentstring=%%s | |
30 | |
31 setlocal formatoptions+=ro | |
32 | |
30634 | 33 if get(g:, 'erlang_extend_path', 1) |
34 " typical erlang.mk paths | |
35 let &l:path = join([ | |
36 \ 'deps/*/include', | |
37 \ 'deps/*/src', | |
38 \ 'deps/*/test', | |
39 \ 'deps/*/apps/*/include', | |
40 \ 'deps/*/apps/*/src', | |
41 \ &g:path], ',') | |
42 " typical rebar3 paths | |
43 let &l:path = join([ | |
44 \ 'apps/*/include', | |
45 \ 'apps/*/src', | |
46 \ '_build/default/lib/*/src', | |
47 \ '_build/default/*/include', | |
48 \ &l:path], ',') | |
49 " typical erlang paths | |
50 let &l:path = join(['include', 'src', 'test', &l:path], ',') | |
51 | |
52 set wildignore+=*/.erlang.mk/*,*.beam | |
53 endif | |
54 | |
23573 | 55 setlocal suffixesadd=.erl,.hrl |
56 | |
57 let &l:include = '^\s*-\%(include\|include_lib\)\s*("\zs\f*\ze")' | |
58 let &l:define = '^\s*-\%(define\|record\|type\|opaque\)' | |
3281 | 59 |
3356 | 60 let s:erlang_fun_begin = '^\a\w*(.*$' |
61 let s:erlang_fun_end = '^[^%]*\.\s*\(%.*\)\?$' | |
62 | |
23573 | 63 if !exists('*GetErlangFold') |
64 function GetErlangFold(lnum) | |
65 let lnum = a:lnum | |
66 let line = getline(lnum) | |
3281 | 67 |
23573 | 68 if line =~ s:erlang_fun_end |
69 return '<1' | |
70 endif | |
3281 | 71 |
23573 | 72 if line =~ s:erlang_fun_begin && foldlevel(lnum - 1) == 1 |
73 return '1' | |
74 endif | |
3281 | 75 |
23573 | 76 if line =~ s:erlang_fun_begin |
77 return '>1' | |
78 endif | |
3281 | 79 |
23573 | 80 return '=' |
81 endfunction | |
82 endif | |
3281 | 83 |
23573 | 84 if !exists('*ErlangFoldText') |
85 function ErlangFoldText() | |
86 let line = getline(v:foldstart) | |
87 let foldlen = v:foldend - v:foldstart + 1 | |
88 let lines = ' ' . foldlen . ' lines: ' . substitute(line, "[\ \t]*", '', '') | |
89 if foldlen < 10 | |
90 let lines = ' ' . lines | |
91 endif | |
92 let retval = '+' . v:folddashes . lines | |
3281 | 93 |
23573 | 94 return retval |
95 endfunction | |
96 endif | |
3281 | 97 |
23573 | 98 let b:undo_ftplugin = "setlocal keywordprg< foldmethod< foldexpr< foldtext<" |
99 \ . " comments< commentstring< formatoptions< suffixesadd< include<" | |
100 \ . " define<" | |
3410
94601b379f38
Updated runtime files. Add Dutch translations.
Bram Moolenaar <bram@vim.org>
parents:
3356
diff
changeset
|
101 |
94601b379f38
Updated runtime files. Add Dutch translations.
Bram Moolenaar <bram@vim.org>
parents:
3356
diff
changeset
|
102 let &cpo = s:cpo_save |
94601b379f38
Updated runtime files. Add Dutch translations.
Bram Moolenaar <bram@vim.org>
parents:
3356
diff
changeset
|
103 unlet s:cpo_save |
23573 | 104 |
105 " vim: sw=2 et |