mirror of
https://github.com/keith/swift.vim.git
synced 2025-12-22 12:14:13 +01:00
@@ -197,7 +197,7 @@ func foo<T: Sequence>() {
|
||||
|
||||
init(argv: UnsafePointer<CString>, count: CInt) {
|
||||
for i in 1..count {
|
||||
let index = Int(i);
|
||||
let index = Int(i)
|
||||
let arg = String.fromCString(argv[index])
|
||||
arguments.append(arg)
|
||||
}
|
||||
@@ -237,3 +237,12 @@ override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject!) {}
|
||||
|
||||
client.host = "example.com"
|
||||
client.pathPrefix = "/foo/"
|
||||
|
||||
func foo () {
|
||||
override func loadView() {
|
||||
super.loadView()
|
||||
if foo {
|
||||
foobar
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
setlocal commentstring=//\ %s
|
||||
" @-@ adds the literal @ to iskeyword for @IBAction and similar
|
||||
setlocal iskeyword+=?,!,@-@,#
|
||||
setlocal tabstop=4
|
||||
setlocal softtabstop=4
|
||||
setlocal shiftwidth=4
|
||||
setlocal tabstop=2
|
||||
setlocal softtabstop=2
|
||||
setlocal shiftwidth=2
|
||||
setlocal completefunc=syntaxcomplete#Complete
|
||||
|
||||
@@ -34,8 +34,9 @@ function! SwiftIndent()
|
||||
return indent(v:lnum) - &tabstop
|
||||
endif
|
||||
|
||||
" Make sure the line has a colon and that the line above isn't blank
|
||||
let thisColon = match(line, ":")
|
||||
if thisColon > 0
|
||||
if thisColon > 0 && previousNum == v:lnum - 1
|
||||
let prevColon = match(previous, ":")
|
||||
if prevColon > 0
|
||||
let minInd = &tabstop + indent(v:lnum)
|
||||
@@ -48,6 +49,15 @@ function! SwiftIndent()
|
||||
endif
|
||||
endif
|
||||
|
||||
" Correctly indent bracketed things when using =
|
||||
if line =~ "}"
|
||||
let newIndent = &tabstop
|
||||
if previous =~ "{"
|
||||
let newIndent = 0
|
||||
endif
|
||||
return indent(previousNum) - newIndent
|
||||
endif
|
||||
|
||||
return indent(previousNum)
|
||||
endfunction
|
||||
|
||||
|
||||
Reference in New Issue
Block a user