@@ -67,10 +67,6 @@ function! s:prev_starts_with(context, expr)
67
67
endfunction
68
68
69
69
function ! s: in_embedded_view ()
70
- if line (" ." ) = ~ ' \s\+\~\%\(e\|E\|L\|H\)"""'
71
- return 0
72
- endif
73
-
74
70
let groups = map (synstack (line (' .' ), col (' .' )), " synIDattr(v:val, 'name')" )
75
71
for group in [' elixirPhoenixESigil' , ' elixirLiveViewSigil' , ' elixirSurfaceSigil' ]
76
72
if index (groups, group) >= 0
@@ -372,35 +368,33 @@ function! s:do_handle_pattern_match_block(relative_line, context)
372
368
endfunction
373
369
374
370
function ! elixir#indent#handle_inside_embedded_view (context)
375
- if s: in_embedded_view ()
376
- let pair_lnum = searchpair (' <[^\/%].*\%\(\/>\)\@<!$' , ' ' , ' <\/.*[^%]>$' , ' bw' , " line('.') == " .a: context .lnum." || s:is_string_or_comment(line('.'), col('.'))" , max ([0 , a: context .lnum - g: elixir_indent_max_lookbehind ]))
377
-
378
- if pair_lnum
379
- if a: context .text = ~ ' <[^\/%].*>.*<\/.*[^\/%]>$'
380
- call s: debug (" open and close tags are on the same line" )
381
- return indent (pair_lnum) + s: sw ()
382
- elseif a: context .text = ~ ' <\/.\+ \/>'
383
- call s: debug (" self-closing tag" )
384
- return indent (pair_lnum)
385
- elseif a: context .text = ~ ' ^\s\+>$'
386
- call s: debug (" a lone >" )
387
- return indent (pair_lnum)
388
- elseif a: context .text = ~ ' <\/.*[^%]>'
389
- call s: debug (" a close tag" )
390
- return indent (pair_lnum)
391
- elseif s: prev_ends_with (a: context , ' ,' )
392
- call s: debug (" multiline" )
393
- return indent (pair_lnum) + 2 * s: sw ()
394
- else
395
- call s: debug (" normal" )
396
- return indent (pair_lnum) + s: sw ()
397
- endif
371
+ if ! s: in_embedded_view ()
372
+ return -1
373
+ endif
374
+
375
+ let pair_lnum = searchpair (' <[^\/%].*\%\(\/>\)\@<!$' , ' ' , ' <\/.*[^%]>$' , ' bw' , " line('.') == " .a: context .lnum." || s:is_string_or_comment(line('.'), col('.'))" , max ([0 , a: context .lnum - g: elixir_indent_max_lookbehind ]))
376
+ if pair_lnum
377
+ if a: context .text = ~ ' <[^\/%].*>.*<\/.*[^\/%]>$'
378
+ call s: debug (" open and close tags are on the same line" )
379
+ return indent (pair_lnum) + s: sw ()
380
+ elseif a: context .text = ~ ' <\/.\+ \/>'
381
+ call s: debug (" self-closing tag" )
382
+ return indent (pair_lnum)
383
+ elseif a: context .text = ~ ' ^\s\+>$'
384
+ call s: debug (" a lone >" )
385
+ return indent (pair_lnum)
386
+ elseif a: context .text = ~ ' <\/.*[^%]>'
387
+ call s: debug (" a close tag" )
388
+ return indent (pair_lnum)
389
+ elseif s: prev_ends_with (a: context , ' ,' )
390
+ call s: debug (" multiline" )
391
+ return indent (pair_lnum) + 2 * s: sw ()
398
392
else
399
- call s: debug (" no lnum" )
400
- return indent (a: context .lnum)
393
+ return -1
401
394
endif
402
395
else
403
- return -1
396
+ call s: debug (" no lnum" )
397
+ return indent (a: context .lnum)
404
398
endif
405
399
endfunction
406
400
0 commit comments