mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-03 22:25:57 +00:00
Use the new string scanner everywhere
This commit is contained in:
parent
b8ce441453
commit
f42090766a
7 changed files with 8 additions and 12 deletions
|
|
@ -3,8 +3,6 @@
|
|||
package completion
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"fmt"
|
||||
"os/exec"
|
||||
"strings"
|
||||
|
|
@ -71,7 +69,7 @@ func complete_themes(completions *cli.Completions, word string, arg_num int) {
|
|||
out, err := exec.Command(kitty, "+runpy", "from kittens.themes.collection import *; print_theme_names()").Output()
|
||||
if err == nil {
|
||||
mg := completions.AddMatchGroup("Themes")
|
||||
scanner := bufio.NewScanner(bytes.NewReader(out))
|
||||
scanner := utils.NewLineScanner(utils.UnsafeBytesToString(out))
|
||||
for scanner.Scan() {
|
||||
theme_name := strings.TrimSpace(scanner.Text())
|
||||
if theme_name != "" && strings.HasPrefix(theme_name, word) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue