Skip to content

Commit 4481438

Browse files
authored
Allow asterisk bullets for plain lists (#408)
1 parent 23f39ce commit 4481438

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

lua/orgmode/org/mappings.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,8 @@ function OrgMappings:handle_return(suffix)
529529
['end'] = { line = end_row, character = 0 },
530530
}
531531

532-
local checkbox = line:match('^(%s*[%+%-])%s*%[[%sXx%-]?%]')
533-
local plain_list = line:match('^%s*[%+%-]')
532+
local checkbox = line:match('^(%s*[%+%-%*])%s*%[[%sXx%-]?%]')
533+
local plain_list = line:match('^%s*[%+%-%*]')
534534
local indent, number_in_list, closer = line:match('^(%s*)(%d+)([%)%.])%s?')
535535
local text_edits = config:respect_blank_before_new_entry({}, 'plain_list_item', {
536536
range = range,

tests/plenary/fixtures/todo.org

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ multiple tags content, tags not read from content :FROMCONTENT:
2121
* NOKEYWORD Headline with wrong todo keyword and wrong tag format :WORK : OFFICE:
2222
- Regular item
2323
- Second recular item
24-
- Neste item
24+
- Nested item
2525
* Multi line list
2626
- this list item
2727
spans more than

tests/plenary/ui/mappings_spec.lua

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -397,21 +397,21 @@ describe('Mappings', function()
397397
'* TODO Test orgmode',
398398
' - Regular item',
399399
' - Second recular item',
400-
' - Neste item',
400+
' - Nested item',
401401
})
402402

403403
assert.are.same({
404404
' - Regular item',
405405
' - Second recular item',
406-
' - Neste item',
406+
' - Nested item',
407407
}, vim.api.nvim_buf_get_lines(0, 3, 6, false))
408408
vim.fn.cursor(4, 1)
409409
vim.cmd([[exe "norm ,\<CR>"]])
410410
assert.are.same({
411411
' - Regular item',
412412
' - ',
413413
' - Second recular item',
414-
' - Neste item',
414+
' - Nested item',
415415
}, vim.api.nvim_buf_get_lines(0, 3, 7, false))
416416
end)
417417

@@ -428,13 +428,13 @@ describe('Mappings', function()
428428
'* TODO Test orgmode',
429429
' - Regular item',
430430
' - Second recular item',
431-
' - Neste item',
431+
' - Nested item',
432432
})
433433

434434
assert.are.same({
435435
' - Regular item',
436436
' - Second recular item',
437-
' - Neste item',
437+
' - Nested item',
438438
}, vim.api.nvim_buf_get_lines(0, 3, 6, false))
439439
vim.fn.cursor(4, 1)
440440
vim.cmd([[exe "norm ,\<CR>"]])
@@ -443,7 +443,7 @@ describe('Mappings', function()
443443
'',
444444
' - ',
445445
' - Second recular item',
446-
' - Neste item',
446+
' - Nested item',
447447
}, vim.api.nvim_buf_get_lines(0, 3, 8, false))
448448
config:extend({
449449
org_blank_before_new_entry = {
@@ -655,17 +655,17 @@ describe('Mappings', function()
655655
'#TITLE: Test',
656656
'',
657657
'* TODO Test orgmode',
658-
' - item',
658+
' * item',
659659
})
660660

661661
assert.are.same({
662-
' - item',
662+
' * item',
663663
}, vim.api.nvim_buf_get_lines(0, 3, 4, false))
664664
vim.fn.cursor(4, 4)
665665
vim.cmd([[exe "norm ,\<CR>"]])
666666
assert.are.same({
667-
' - item',
668-
' - ',
667+
' * item',
668+
' * ',
669669
}, vim.api.nvim_buf_get_lines(0, 3, 5, false))
670670
end
671671
)
@@ -675,23 +675,23 @@ describe('Mappings', function()
675675
'#TITLE: Test',
676676
'',
677677
'* TODO Test orgmode',
678-
' - [ ] The checkbox',
679-
' - [X] The checkbox 2',
680-
' - [ ] Nested checkbox',
678+
' * [ ] The checkbox',
679+
' * [X] The checkbox 2',
680+
' * [ ] Nested checkbox',
681681
'multiple tags content, tags not read from content :FROMCONTENT:',
682682
})
683683

684684
assert.are.same({
685-
' - [X] The checkbox 2',
686-
' - [ ] Nested checkbox',
685+
' * [X] The checkbox 2',
686+
' * [ ] Nested checkbox',
687687
'multiple tags content, tags not read from content :FROMCONTENT:',
688688
}, vim.api.nvim_buf_get_lines(0, 4, 7, false))
689689
vim.fn.cursor(5, 1)
690690
vim.cmd([[exe "norm ,\<CR>"]])
691691
assert.are.same({
692-
' - [X] The checkbox 2',
693-
' - [ ] Nested checkbox',
694-
' - [ ] ',
692+
' * [X] The checkbox 2',
693+
' * [ ] Nested checkbox',
694+
' * [ ] ',
695695
'multiple tags content, tags not read from content :FROMCONTENT:',
696696
}, vim.api.nvim_buf_get_lines(0, 4, 8, false))
697697
end)

0 commit comments

Comments
 (0)