Search bug on Windows

This commit is contained in:
Liang Ding 2015-09-26 16:01:09 +08:00
parent bb8b5534d2
commit c743c6f007
1 changed files with 2 additions and 1 deletions

View File

@ -843,7 +843,8 @@ func searchInFile(path string, text string) []*Snippet {
ch := strings.Index(strings.ToLower(line), strings.ToLower(text))
if -1 != ch {
snippet := &Snippet{Path: path, Line: idx + 1, Ch: ch + 1, Contents: []string{line}}
snippet := &Snippet{Path: filepath.ToSlash(path),
Line: idx + 1, Ch: ch + 1, Contents: []string{line}}
ret = append(ret, snippet)
}