浏览代码

Improve query list formatting

Maxim Baz 8 年之前
父节点
当前提交
9fa8c9265e
共有 3 个文件被更改,包括 7 次插入7 次删除
  1. 3 3
      pacman/pacman.go
  2. 3 3
      query.go
  3. 1 1
      yay.go

+ 3 - 3
pacman/pacman.go

@@ -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)
 	}
 }

+ 3 - 3
query.go

@@ -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)
 	}
 

+ 1 - 1
yay.go

@@ -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 {