File tree 2 files changed +22
-0
lines changed
2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -217,6 +217,12 @@ function! s:indent_like_opening_paren(lnum)
217
217
return res + s: sw ()
218
218
endif
219
219
endif
220
+
221
+ " Indent by one level with colon on previous line (dictionary keys).
222
+ if getline (a: lnum- 1 ) = ~# ' :\s*$'
223
+ let res = res + s: sw ()
224
+ endif
225
+
220
226
return res
221
227
endfunction
222
228
Original file line number Diff line number Diff line change 90
90
end
91
91
end
92
92
93
+ describe "after a dictionary key" do
94
+ before { vim . feedkeys 'imydict = {"12345": ' }
95
+
96
+ it "indents to opening paren + shiftwidth" do
97
+ vim . feedkeys '\<CR>'
98
+ indent . should == 10 + shiftwidth
99
+ end
100
+ it "on a new line indents to opening paren + shiftwidth" do
101
+ vim . feedkeys '123,\<CR>"4567": '
102
+ indent . should == 10
103
+ vim . feedkeys '\<CR>'
104
+ indent . should == 10 + shiftwidth
105
+ end
106
+ end
107
+
108
+
93
109
describe "when using gq to reindent a '(' that is" do
94
110
before { vim . feedkeys 'itest(' }
95
111
it "something and has a string without spaces at the end" do
You can’t perform that action at this time.
0 commit comments