Skip to content

Commit

Permalink
Make TUI find markdowns with a variety of file extensions
Browse files Browse the repository at this point in the history
List from GitHub's supported extensions:

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

Fixes #233.
  • Loading branch information
muesli committed Feb 1, 2021
1 parent 0da9927 commit 2088bac
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 2088bac

Please sign in to comment.