Skip to content

Commit a0a4eb9

Browse files
committed
Handle more edge cases with inheriting indentation
1 parent 484c281 commit a0a4eb9

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(foo bar
2-
"This string has unpaired brackets
3-
["
4-
α
5-
[β])
2+
"This string has unpaired brackets [
3+
and is indented weirdly."
4+
α
5+
[β])
66

77
;; vim:ft=clojure:
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
(foo bar
2-
"This string has unpaired brackets
3-
["
4-
a
5-
6-
[
7-
a
2+
"This string has unpaired brackets [
3+
and is indented weirdly."
4+
a
5+
6+
[
7+
88
b
9+
c
910

10-
c])
11+
d])
1112

1213
;; vim:ft=clojure:

clj/test/vim_clojure_static/indent_test.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
(test-indent "is inherited from previous element"
77
:in "test-inherit-indent.in"
88
:out "test-inherit-indent.out"
9-
:keys "\\<CR>s\\<Esc>Oa\\<Esc>/β\\<CR>s\\<CR>\\<C-H>\\<C-H>a\\<CR>b\\<CR>\\<CR>c\\<Esc>"))
9+
:keys "\\<CR>s\\<C-O>Oa\\<Esc>/β\\<CR>s\\<CR>\\<CR>\\<C-H>\\<C-H>\\<C-H>\\<C-H>\\<C-H>\\<C-H>\\<C-H>b\\<CR>c\\<CR>\\<CR>d\\<Esc>"))

indent/clojure.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ if exists("*searchpairpos")
347347

348348
if bracket_count == 0
349349
" Check if this is part of a multiline string
350-
call cursor(lnum, 0)
350+
call cursor(lnum, 1)
351351
if s:syn_id_name() !~? '\vstring|regex'
352352
return indent(lnum)
353353
endif

0 commit comments

Comments
 (0)