This repository was archived by the owner on Feb 23, 2025. It is now read-only.
File tree 3 files changed +12
-2
lines changed
3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -19,9 +19,14 @@ function! iced#format#calculate_indent(lnum) abort
19
19
return iced#system#get (s: formatter ).calculate_indent (a: lnum )
20
20
endfunction
21
21
22
+ function ! s: set_indentexpr () abort
23
+ setlocal indentexpr = GetIcedIndent ()
24
+ endfunction
25
+
22
26
function ! iced#format#set_indentexpr () abort
23
27
if get (g: , ' iced_enable_auto_indent' , v: true )
24
- setlocal indentexpr = GetIcedIndent ()
28
+ " Delay `setlocal` if called by ftplugin, because `GetIcedIndent` is not yet loaded
29
+ call iced#system#get (' future' ).do ({- > s: set_indentexpr ()})
25
30
endif
26
31
endfunction
27
32
Original file line number Diff line number Diff line change @@ -454,6 +454,11 @@ for key in ['error', 'trace']
454
454
endfor
455
455
" " }}}
456
456
457
+ " Set `indentexpr` without waiting for a REPL connection when native-image formatter is used
458
+ if g: iced_formatter !=# ' default'
459
+ call iced#format#set_indentexpr ()
460
+ endif
461
+
457
462
let &cpoptions = s: save_cpo
458
463
unlet s: save_cpo
459
464
Original file line number Diff line number Diff line change 1
1
let s: save_cpo = &cpo
2
2
set cpo &vim
3
3
4
- " NOTE: setting indentexpr is executed at nREPL connection
4
+ " NOTE: setting indentexpr is executed at nREPL connection or ftplugin/clojure.vim
5
5
function ! GetIcedIndent ()
6
6
return iced#format#calculate_indent (v: lnum )
7
7
endfunction
You can’t perform that action at this time.
0 commit comments