Make TUI find markdowns with a variety of file extensions

List from GitHub's supported extensions:

- .md
- .markdown
- .mdown
- .mkdn
- .mkd

Fixes #233.
This commit is contained in:
Christian Muehlhaeuser 2021-02-01 04:52:13 +01:00
parent 0da9927f37
commit 2088bac668

View file

@ -32,6 +32,10 @@ var (
config Config
glowLogoTextColor = lib.Color("#ECFD65")
markdownExtensions = []string{
"*.md", "*.mdown", "*.mkdn", "*.mkd", "*.markdown",
}
// True if we're logging to a file, in which case we'll log more stuff.
debug = false
@ -526,7 +530,7 @@ func findLocalFiles(m model) tea.Cmd {
ignore = ignorePatterns(m)
}
ch, err := gitcha.FindFilesExcept(cwd, []string{"*.md"}, ignore)
ch, err := gitcha.FindFilesExcept(cwd, markdownExtensions, ignore)
if err != nil {
if debug {
log.Println("error finding local files:", err)