Skip to content

Commit

Permalink
Add + as a valid unordered list marker
Browse files Browse the repository at this point in the history
  • Loading branch information
jakewvincent committed Jan 5, 2023
1 parent 8206b61 commit 6f56ec8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ require('mkdnflow').setup({
* 🆕 Fold the section the cursor is currently in—even if the cursor is not on the heading—using `<leader>f`

### Lists
* List markers recognized: `-`, `*`, and `+`
* Toggle the status of a to-do list item on the current line (mapped to `<C-Space>` by default). Using the default settings, toggling will result in the following changes. To-do symbols [can be customized](#to_do-dictionary-like-table) (make sure to use the [luautf8 luarock dependency](#if-you-wish-to-use-custom-utf-8-to-do-symbols-add-the-luautf8-luarock-dependency) if you want to use utf8 to-do symbols).
* `* [ ] ...``* [-] ...`
* `* [-] ...``* [X] ...`
Expand Down Expand Up @@ -646,6 +647,7 @@ These default mappings can be disabled; see [Configuration](#%EF%B8%8F-configura


## 🔧 Recent changes
* 01/05/23: Added `+` as a valid unordered list or unordered to-do list marker (requested in [issue #112](https://github.com/jakewvincent/mkdnflow.nvim/issues/112))
* 01/02/23: Automatic links (URLs enclosed in `<` + `>` and lacking the usual markdown link syntax that are automatically rendered as links when compiled into HTML) will now be followed
* 10/08/22: Create links using the system clipboard content as the link's source
* 10/02/22: Add ability to consider n lines of context around the cursor when following, renaming, or removing links
Expand Down
26 changes: 13 additions & 13 deletions lua/mkdnflow/lists.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ local M = {}
M.patterns = {
ultd = {
li_type = 'ultd',
main = '^%s*[*-]%s+%[.%]%s+',
indentation = '^(%s*)[*-]%s+%[.%]',
marker = '^%s*([*-]%s+)%[.%]%s+',
content = '^%s*[*-]%s+%[.%]%s+(.+)',
demotion = '^%s*[*-]%s+',
empty = '^%s*[*-]%s+%[.%]%s+$'
main = '^%s*[*-+]%s+%[.%]%s+',
indentation = '^(%s*)[*+-]%s+%[.%]',
marker = '^%s*([*-+]%s+)%[.%]%s+',
content = '^%s*[*-+]%s+%[.%]%s+(.+)',
demotion = '^%s*[*-+]%s+',
empty = '^%s*[*-+]%s+%[.%]%s+$'
},
oltd = {
li_type = 'oltd',
Expand All @@ -59,13 +59,13 @@ M.patterns = {
},
ul = {
li_type = 'ul',
main = '^%s*[-*]%s+',
indentation = '^(%s*)[-*]%s+',
marker = '^%s*([-*]%s+)',
pre = '^%s*[-*]',
content = '^%s*[-*]%s+(.+)',
main = '^%s*[-*+]%s+',
indentation = '^(%s*)[-*+]%s+',
marker = '^%s*([-*+]%s+)',
pre = '^%s*[-*+]',
content = '^%s*[-*+]%s+(.+)',
demotion = '^%s*',
empty = '^%s*[-*]%s+$'
empty = '^%s*[-*+]%s+$'
},
ol = {
li_type = 'ol',
Expand Down Expand Up @@ -170,7 +170,7 @@ local get_status = function(line)
if line then
for _, v in ipairs(to_do_symbols) do
v = utils.luaEscape(v)
local ul = "^%s*[*-]%s+%[" .. v .. "%]%s+"
local ul = "^%s*[*-+]%s+%[" .. v .. "%]%s+"
local ol = "^%s*%d+%.%s+%[" .. v .. "%]%s+"
local match = line:match(ul, nil) or line:match(ol, nil)
if match then todo = v end
Expand Down

0 comments on commit 6f56ec8

Please sign in to comment.