Skip to content

Commit

Permalink
Improve relative date syntax matching
Browse files Browse the repository at this point in the history
  • Loading branch information
rbong committed Nov 19, 2024
1 parent afbbe41 commit be06153
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion syntax/floggraph.vim
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ else
" Local format
exec 'syntax match flogDate contained nextgroup=flogHash,flogAuthor,flogRef /\v' . weekday_name_pattern . ' ' . month_name_pattern . ' \d{1,2}%( ' . iso_time_pattern . ')? \d{4}' . '%( |$)/'
" Relative format
exec 'syntax match flogDate contained nextgroup=flogHash,flogAuthor,flogRef /\v%(\d+ %([yY]ear|[mM]onth|[wW]eek|[dD]ay|[hH]our|[mM]inute|[sS]econd)s? [aA]go)%( |$)/'
exec 'syntax match flogDate contained nextgroup=flogHash,flogAuthor,flogRef /\v%(\d+ %([yY]ear|[mM]onth|[wW]eek|[dD]ay|[hH]our|[mM]inute|[sS]econd)s?%(, )?)+ [aA]go%( |$)/'
" Human formats
exec 'syntax match flogDate contained nextgroup=flogHash,flogAuthor,flogRef /\v' . weekday_name_pattern . ' ' . iso_time_pattern . '%( |$)/'
exec 'syntax match flogDate contained nextgroup=flogHash,flogAuthor,flogRef /\v' . month_name_pattern . ' \d{1,2} \d{4}' . '%( |$)/'
Expand Down

0 comments on commit be06153

Please sign in to comment.