Merge branch 'maximbaz-improve-query-list-formatting' into dev

This commit is contained in:
Jguer 2017-05-21 21:40:10 +01:00
commit 22f8dcf150
3 changed files with 7 additions and 7 deletions

View File

@ -71,9 +71,9 @@ func (s Query) PrintSearch() {
var toprint string
if config.YayConf.SearchMode == config.NumberMenu {
if config.YayConf.SortMode == config.BottomUp {
toprint += fmt.Sprintf("%d ", len(s)-i-1)
toprint += fmt.Sprintf("\x1b[33m%d\x1b[0m ", len(s)-i-1)
} else {
toprint += fmt.Sprintf("%d ", i)
toprint += fmt.Sprintf("\x1b[33m%d\x1b[0m ", i)
}
} else if config.YayConf.SearchMode == config.Minimal {
fmt.Println(res.Name())
@ -93,7 +93,7 @@ func (s Query) PrintSearch() {
}
}
toprint += "\n" + res.Description()
toprint += "\n " + res.Description()
fmt.Println(toprint)
}
}

View File

@ -17,9 +17,9 @@ func printAURSearch(q aur.Query, start int) {
var toprint string
if config.YayConf.SearchMode == config.NumberMenu {
if config.YayConf.SortMode == config.BottomUp {
toprint += fmt.Sprintf("%d ", len(q)+start-i-1)
toprint += fmt.Sprintf("\x1b[33m%d\x1b[0m ", len(q)+start-i-1)
} else {
toprint += fmt.Sprintf("%d ", start+i)
toprint += fmt.Sprintf("\x1b[33m%d\x1b[0m ", start+i)
}
} else if config.YayConf.SearchMode == config.Minimal {
fmt.Println(res.Name)
@ -37,7 +37,7 @@ func printAURSearch(q aur.Query, start int) {
if _, err := localDb.PkgByName(res.Name); err == nil {
toprint += fmt.Sprintf("\x1b[32;40mInstalled\x1b[0m")
}
toprint += "\n" + res.Description
toprint += "\n " + res.Description
fmt.Println(toprint)
}

2
yay.go
View File

@ -184,7 +184,7 @@ func numberMenu(pkgS []string, flags []string) (err error) {
printAURSearch(aq, numpq)
}
fmt.Printf("\x1b[32m%s\x1b[0m\nNumbers:", "Type numbers to install. Separate each number with a space.")
fmt.Printf("\x1b[32m%s\x1b[0m\nNumbers: ", "Type numbers to install. Separate each number with a space.")
reader := bufio.NewReader(os.Stdin)
numberBuf, overflow, err := reader.ReadLine()
if err != nil || overflow {