I don't know what I was thinking with this. Previously all comment lines
would indent as the line above them. This doesn't work because of many
cases such as:
```swift
if foo {
// something
}
```
Previously this comment would be forced on to column 0. Now comments are
indented as everything else.
This fixes the python-style indenting that was previously done. If you
had a codeblock like this:
```swift
let foo = Thing(arg: arg,
arg2: arg2)
```
The indent of the second line would be the opening paren +1. This has
changed to:
```swift
let foo = Thing(arg: arg,
arg2: arg2)
```
Which is the indent of the opening paren line +1 'shiftwidth'
This fixes the case where the closing square bracket of something (like
an array) is on the same line as an entry, so it should be indented one
level above the opening square bracket
Previously when you typed, or tried to reindent a ] character, it didn't
work. This was because the brackets weren't escaped in search pair. This
also fixes auto indenting when typing the close square bracket. This is
now special cased because search pair returns no matches right after
typing the bracket.
This updates the previously dumb NumberOfMatches function to take the
index of the line, and make sure the match at that line shouldn't be
ignored. It should be ignored if the character is part of a string or a
comment. Without this change those characters could be taken into
account when indenting subsequent lines.
Closes#65
This fixes a issue where indentation would take characters that were in
comments into account. Meaning that if you had something like this:
```swift
// if something {
let foo = 1
```
The second line would be indented.
This also updates the indent file to no longer use normal mode commands
and instead call cursor() which I apparently didn't know about at the
time of writing this originally.
Closes: https://github.com/keith/swift.vim/pull/58