aboutsummaryrefslogtreecommitdiff
path: root/go-src/windowsHelpers.go
diff options
context:
space:
mode:
authorSyndamia <kamen.d.mladenov@protonmail.com>2021-09-11 18:15:54 +0300
committerSyndamia <kamen.d.mladenov@protonmail.com>2021-09-11 18:15:54 +0300
commit3ebef9072f9de0ff1834c7286da041ed33448a59 (patch)
tree28e126ee1dd84c3e4e7cd3f7eb907dbe9f6571a7 /go-src/windowsHelpers.go
parent501a530885c408a88c0fec0b38325410bd27e1d0 (diff)
downloadctfc-3ebef9072f9de0ff1834c7286da041ed33448a59.tar
ctfc-3ebef9072f9de0ff1834c7286da041ed33448a59.tar.gz
ctfc-3ebef9072f9de0ff1834c7286da041ed33448a59.zip
Fixed comlex input actions defering with wrong values on invalid left and right page navigation
Diffstat (limited to 'go-src/windowsHelpers.go')
-rw-r--r--go-src/windowsHelpers.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/go-src/windowsHelpers.go b/go-src/windowsHelpers.go
index f59f34f..7d2e35c 100644
--- a/go-src/windowsHelpers.go
+++ b/go-src/windowsHelpers.go
@@ -90,26 +90,26 @@ func handleInputActions(input string, handleNav bool, ia ...inputAction) func()
return nil
}
-func handleComplexInputActions(input string, allValues []string, nameSep string, pageArgument *string, currentWindow window, singleValueWindow window, existsCheck func(string) bool) {
+func handleComplexInputActions(input string, allValues []string, nameSep string, pageArgument *string, currentWindow window, currentWindowValues []string, singleValueWindow window, existsCheck func(string) bool) {
// If user input is number, navigate to chat of given number, else show error
if chatI, err := strconv.Atoi(input); chatI >= 0 && chatI <= len(allValues) && err == nil {
defer singleValueWindow(strings.Split(allValues[utils.MaxInt(len(allValues)-pageSize*len(*pageArgument), 0)+chatI-1], " : ")[0])
- } else if input == ">" && pageArgument != nil {
+ } else if input == ">" {
// If possible, increment to the next page (adds a dot to the end of the string)
if len(*pageArgument) < totalPages(len(allValues)) {
*pageArgument += "."
}
- defer currentWindow(allValues...)
+ defer currentWindow(currentWindowValues...)
} else if input == "<" {
// If possible, decrement to the previous page (removes a dot from the string)
if len(*pageArgument) > 1 {
utils.StrShortenRight(*&pageArgument, 1)
}
- defer currentWindow(allValues...)
+ defer currentWindow(currentWindowValues...)
} else if existsCheck(input) {
defer singleValueWindow(input)
} else {
- defer showError(invalidCommand, currentWindow)
+ defer showError(invalidCommand, currentWindow, currentWindowValues...)
}
}