diff options
author | Christian Muehlhaeuser <muesli@gmail.com> | 2019-07-19 12:53:16 +0200 |
---|---|---|
committer | Christian Muehlhaeuser <muesli@gmail.com> | 2019-07-19 12:53:16 +0200 |
commit | 1fa41a37965214d82161034898eff177dbd456d4 (patch) | |
tree | ee869fafbf9779fda5c9f59252cf6ae7c0390132 | |
parent | 09296c0214c4cc7477fe53bc79c54805899c6d19 (diff) |
Simplify code
`a += b` instead of `a = a + b`.
-rw-r--r-- | ui/filetree_viewmodel.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ui/filetree_viewmodel.go b/ui/filetree_viewmodel.go index 7394070..f2186ed 100644 --- a/ui/filetree_viewmodel.go +++ b/ui/filetree_viewmodel.go @@ -198,7 +198,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 } @@ -258,7 +258,7 @@ func (vm *FileTreeViewModel) PageDown() error { vm.bufferIndex = 0 vm.TreeIndex = nextBufferIndexLowerBound } else { - vm.bufferIndex = vm.bufferIndex - newLines + vm.bufferIndex -= newLines } return nil @@ -284,7 +284,7 @@ func (vm *FileTreeViewModel) PageUp() error { vm.bufferIndex = 0 vm.TreeIndex = nextBufferIndexLowerBound } else { - vm.bufferIndex = vm.bufferIndex + newLines + vm.bufferIndex += newLines } return nil } |