File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 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)
217217 return res + s: sw ()
218218 endif
219219 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+
220226 return res
221227endfunction
222228
Original file line number Diff line number Diff line change 9090 end
9191 end
9292
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+
93109 describe "when using gq to reindent a '(' that is" do
94110 before { vim . feedkeys 'itest(' }
95111 it "something and has a string without spaces at the end" do
You can’t perform that action at this time.
0 commit comments