Skip to content

Commit 6f02203

Browse files
committed
Catch missing function exception for lexima
1 parent c49dd8d commit 6f02203

2 files changed

Lines changed: 15 additions & 9 deletions

File tree

plugin/interfaces/lexima.vim

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
autocmd FileType clojure let b:lexima_disabled = 1
33

44
" Add rules for LaTeX $ pairs.
5-
call lexima#add_rule(
6-
\ {'char': '$', 'input_after': '$', 'filetype': 'latex'})
7-
call lexima#add_rule(
8-
\ {'char': '$', 'at': '\%#\$', 'leave': 1, 'filetype': 'latex'})
9-
call lexima#add_rule(
10-
\ {'char': '<BS>', 'at': '\$\%#\$', 'delete': 1, 'filetype': 'latex'})
5+
try
6+
call lexima#add_rule(
7+
\ {'char': '$', 'input_after': '$', 'filetype': 'latex'})
8+
call lexima#add_rule(
9+
\ {'char': '$', 'at': '\%#\$', 'leave': 1, 'filetype': 'latex'})
10+
call lexima#add_rule(
11+
\ {'char': '<BS>', 'at': '\$\%#\$', 'delete': 1, 'filetype': 'latex'})
12+
catch /^Vim\%((\a\+)\)\=:E117/
13+
endtry

plugin/mappings/lexima.vim

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ nnoremap <silent><expr> coe
55
\ ":<C-U>let b:lexima_disabled = 1<CR>:echo 'Disabled lexima on buffer'<CR>"
66
77
" Fix newline mappings to work with lexima.
8-
call lexima#insmode#define_altanative_key('<C-CR>', '<CR>')
9-
call lexima#insmode#define_altanative_key('<S-CR>', '<CR>')
10-
call lexima#insmode#define_altanative_key('<C-J>', '<CR>')
8+
try
9+
call lexima#insmode#define_altanative_key('<C-CR>', '<CR>')
10+
call lexima#insmode#define_altanative_key('<S-CR>', '<CR>')
11+
call lexima#insmode#define_altanative_key('<C-J>', '<CR>')
12+
catch /^Vim\%((\a\+)\)\=:E117/
13+
endtry
1114

1215
" Use ctrl-h as backspace.
1316
imap <expr> <C-H> lexima#expand('<LT>BS>', 'i')

0 commit comments

Comments
 (0)