summaryrefslogtreecommitdiffstats
path: root/autoload/jsx_pretty
diff options
context:
space:
mode:
Diffstat (limited to 'autoload/jsx_pretty')
-rw-r--r--autoload/jsx_pretty/indent.vim9
1 files changed, 9 insertions, 0 deletions
diff --git a/autoload/jsx_pretty/indent.vim b/autoload/jsx_pretty/indent.vim
index 9dd0e5b1..d37d3990 100644
--- a/autoload/jsx_pretty/indent.vim
+++ b/autoload/jsx_pretty/indent.vim
@@ -124,6 +124,8 @@ function! jsx_pretty#indent#get(js_indent)
else
return prev_ind
endif
+ elseif prev_line =~ '^\<return'
+ return prev_ind
else
return prev_ind - s:sw()
endif
@@ -188,6 +190,13 @@ function! jsx_pretty#indent#get(js_indent)
else
let ind = a:js_indent()
+ " Issue #68
+ " return (<div>
+ " |<div>)
+ if prev_line =~ '^\<return' && line =~ '^<\s*' . s:end_tag
+ return prev_ind
+ endif
+
" If current syntax is not a jsx syntax group
if s:syn_xmlish(prev_syn_eol) && line !~ '^[)\]}]'
let sol = matchstr(line, s:opfirst)