File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- Copyright (c) 2015-2022 Akinori Hattori <hattya@gmail.com>
1+ Copyright (c) 2015-2023 Akinori Hattori <hattya@gmail.com>
22
33Permission is hereby granted, free of charge, to any person obtaining a copy
44of this software and associated documentation files (the "Software"), to deal
Original file line number Diff line number Diff line change @@ -173,14 +173,14 @@ Describe filetype indent
173173
174174 It indents like the previous line (triple-quoted string)
175175 let in = "def func():\<CR>"
176- let in .= "s = '''\\\<CR>0\<C-D>spam\<CR>ham \<CR>eggs \<CR>'''\<CR>"
176+ let in .= "s = '''\\\<CR>0\<C-D>spam\<CR>eggs \<CR>ham \<CR>'''\<CR>"
177177 let in .= "v ="
178178 let out = [
179179 \ 'def func():',
180180 \ " s = '''\\",
181181 \ 'spam',
182- \ 'ham',
183182 \ 'eggs',
183+ \ 'ham',
184184 \ "'''",
185185 \ ' v =',
186186 \]
@@ -308,6 +308,39 @@ Describe filetype indent
308308 \]
309309 Assert Equals(Insert(in), Buffer(out))
310310 End
311+
312+ It indents by the option value (hanging indent)
313+ let in = "def func(\<CR>*args,\<CR>**kwargs\<CR>):"
314+ let out = [
315+ \ 'def func(',
316+ \ ' *args,',
317+ \ ' **kwargs',
318+ \ '):',
319+ \]
320+ Assert Equals(Insert(in), Buffer(out))
321+ End
322+
323+ It decreases the indent level after pass
324+ let in = "def spam():\<CR>pass\<CR>"
325+ let in .= "def eggs():"
326+ let out = [
327+ \ 'def spam():',
328+ \ ' pass',
329+ \ 'def eggs():',
330+ \]
331+ Assert Equals(Insert(in), Buffer(out))
332+ End
333+
334+ It decreases the indent level after return
335+ let in = "def spam():\<CR>return\<CR>"
336+ let in .= "def eggs():"
337+ let out = [
338+ \ 'def spam():',
339+ \ ' return',
340+ \ 'def eggs():',
341+ \]
342+ Assert Equals(Insert(in), Buffer(out))
343+ End
311344 End
312345
313346 Describe if statement
You can’t perform that action at this time.
0 commit comments