diff --git a/go.mod b/go.mod index 4a535ce..d0962fa 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/dustin/go-humanize v1.0.1 github.com/mattn/go-runewidth v0.0.15 github.com/mitchellh/go-homedir v1.1.0 - github.com/muesli/gitcha v0.2.0 + github.com/muesli/gitcha v0.3.0 github.com/muesli/go-app-paths v0.2.2 github.com/muesli/reflow v0.3.0 github.com/muesli/termenv v0.15.2 diff --git a/go.sum b/go.sum index 95f233d..37fc917 100644 --- a/go.sum +++ b/go.sum @@ -214,6 +214,9 @@ github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELU github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo= github.com/muesli/gitcha v0.2.0 h1:+wOgT2dI9s2Tznj1t1rb/qkK5e0cb6qD8c4IX2TR/YY= github.com/muesli/gitcha v0.2.0/go.mod h1:Ri8m9TZS4+ORG4JVmVKUQcWZuxDvUW3UKxMdQfzG2zI= +github.com/muesli/gitcha v0.3.0 h1:+PJkVKrDXVB0VgRn/yVx2CqSVSDGMSepzvohsCrPYtQ= +github.com/muesli/gitcha v0.3.0/go.mod h1:vX3jFL+XcEUq1uY74RCjLSZfAV+ZuvLg70/NGPdXn84= +github.com/muesli/go-app-paths v0.2.1/go.mod h1:SxS3Umca63pcFcLtbjVb+J0oD7cl4ixQWoBKhGEtEho= github.com/muesli/go-app-paths v0.2.2 h1:NqG4EEZwNIhBq/pREgfBmgDmt3h1Smr1MjZiXbpZUnI= github.com/muesli/go-app-paths v0.2.2/go.mod h1:SxS3Umca63pcFcLtbjVb+J0oD7cl4ixQWoBKhGEtEho= github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s= diff --git a/ui/ui.go b/ui/ui.go index ac2bd95..bb7703d 100644 --- a/ui/ui.go +++ b/ui/ui.go @@ -331,12 +331,15 @@ func findLocalFiles(m commonModel) tea.Cmd { } log.Debug("local directory is", "cwd", cwd) - var ignore []string - if !m.cfg.ShowAllFiles { - ignore = ignorePatterns(m) + + // Switch between FindFiles and FindAllFiles to bypass .gitignore rules + var ch chan gitcha.SearchResult + if m.cfg.ShowAllFiles { + ch, err = gitcha.FindAllFilesExcept(cwd, markdownExtensions, nil) + } else { + ch, err = gitcha.FindFilesExcept(cwd, markdownExtensions, ignorePatterns(m)) } - ch, err := gitcha.FindFilesExcept(cwd, markdownExtensions, ignore) if err != nil { log.Error("error finding local files", "error", err) return errMsg{err}