Use the new string scanner everywhere

This commit is contained in:
Kovid Goyal 2023-03-08 13:31:27 +05:30
parent b8ce441453
commit f42090766a
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
7 changed files with 8 additions and 12 deletions

View file

@ -4,7 +4,6 @@ package themes
import (
"archive/zip"
"bufio"
"encoding/json"
"errors"
"fmt"
@ -241,7 +240,7 @@ func (self *Theme) Settings() (map[string]string, error) {
return nil, err
}
self.settings = make(map[string]string, 64)
scanner := bufio.NewScanner(strings.NewReader(code))
scanner := utils.NewLineScanner(code)
for scanner.Scan() {
line := strings.TrimSpace(scanner.Text())
if line != "" && line[0] != '#' {