Merge pull request #206 from muesli/linter-fixes

Simplify code
This commit is contained in:
Alex Goodman 2019-07-21 15:48:25 -04:00 committed by GitHub
commit 68acfcdd64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -196,7 +196,7 @@ func (vm *FileTreeViewModel) CursorLeft(filterRegex *regexp.Regexp) error {
}
if vm.bufferIndex > moveIndex {
vm.bufferIndex = vm.bufferIndex - moveIndex
vm.bufferIndex -= moveIndex
} else {
vm.bufferIndex = 0
}
@ -256,7 +256,7 @@ func (vm *FileTreeViewModel) PageDown() error {
vm.bufferIndex = 0
vm.TreeIndex = nextBufferIndexLowerBound
} else {
vm.bufferIndex = vm.bufferIndex - newLines
vm.bufferIndex -= newLines
}
return nil
@ -282,7 +282,7 @@ func (vm *FileTreeViewModel) PageUp() error {
vm.bufferIndex = 0
vm.TreeIndex = nextBufferIndexLowerBound
} else {
vm.bufferIndex = vm.bufferIndex + newLines
vm.bufferIndex += newLines
}
return nil
}