Skip to content

Commit

Permalink
Allow pressing enter in the middle of a line within lists (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
SidOfc committed May 18, 2020
1 parent 22dfbf2 commit 6ed0ae0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ Before we dive in I'd like to give a special thanks to the following contributor
- [@samarulmeu](https://github.com/samarulmeu)
- idea to mark every line with a quote mark
- discovering a bug with double insertion of quote marks
- finding duplicate helptag
- his critical thinking on enhancing <kbd>g</kbd><kbd>f</kbd> and <kbd>g</kbd><kbd>x</kbd>
- [@yous](https://github.com/yous)
- discovering a bug when using unicode characters in list items
- [@marcdeop](https://github.com/marcdeop) ([Erasys](https://www.erasys.de/))
Expand Down Expand Up @@ -1517,7 +1519,7 @@ See [CHANGELOG.md](CHANGELOG.md) for older changes.
- Fix: no-op folding functions when `g:markdown_folding` is enabled
- Fix: allow mkdx to work with [plasticboy/vim-markdown](https://github.com/plasticboy/vim-markdown) enabled
- Fix: insertion of double quote marks on <kbd>enter</kbd>
- Fix: removed duplicate helptag causing Vundle to crash
- Fix: removed duplicate helptag causing Vundle to crash ([#92](../../issues/92) by @samarulmeu)
- Fix: `<details />` TOC not unindenting properly when `&sw` is `0`
- Fix: typo in README ([#88](../../issues/88) by @Ginner)
Expand Down
2 changes: 1 addition & 1 deletion autoload/mkdx.vim
Original file line number Diff line number Diff line change
Expand Up @@ -1731,7 +1731,7 @@ fun! mkdx#EnterHandler()

if (!empty(line) && g:mkdx#settings.enter.enable)
let len = strwidth(line)
let at_end = cnum > len
let at_end = 1 " implementation before #107: cnum > len
let results = matchlist(line, sp_pat)
let t = get(results, 2, '')
let t = t == '>' ? '' : t
Expand Down
15 changes: 2 additions & 13 deletions test/components/lists.vader
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Do (<enter> in the middle of list item performs regular <enter>):

Expect (An empty list item):
- list
item
- item
- list item

Do (<shift>+<enter> in the middle of list item performs indented <enter>):
Expand All @@ -127,17 +127,6 @@ Given (A nested markdown list):
2.2. subtask
3. hello

Do (<enter> in the middle of list item performs regular <enter>):
2j8la\<cr>

Expect (An empty list item):
1. task
2. task
2.1.
subtask
2.2. subtask
3. hello

Do (<shift>+<enter> in the middle of list item performs indented <enter>):
2j11la\<s-cr>

Expand Down Expand Up @@ -187,8 +176,8 @@ Expect (An empty list item):
> 1. task
> 2. task
> 2.1.
> subtask
> 2.2. subtask
> 2.3. subtask
> 3. hello

Do (<shift>+<enter> in the middle of list item performs indented <enter>):
Expand Down

0 comments on commit 6ed0ae0

Please sign in to comment.