Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions openspec/specs/activation-and-mappings/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ The plugin SHALL not install default mappings when default mappings are disabled
- WHEN a supported buffer is opened
- THEN default normal-mode bullet mappings are not installed

#### Scenario: Empty buffer mappings disabled by default {#ACT-006}

- GIVEN a new buffer has no filetype
- AND empty-buffer activation is disabled
- WHEN insert-mode return is used after a bullet-like line
- THEN Neovim inserts a plain newline without continuing the bullet marker

### Requirement: Apply newline mapping in supported buffers

The plugin SHALL install the newline continuation mapping in configured filetypes when mappings are enabled.
Expand All @@ -52,3 +59,9 @@ The plugin SHALL install the newline continuation mapping in configured filetype
- AND the current line is a recognized bullet item
- WHEN insert-mode return is used at the end of the line
- THEN a continued bullet item is inserted

#### Scenario: Text file buffers are supported {#ACT-007}

- GIVEN a `.txt` buffer is opened
- WHEN Neovim detects its filetype
- THEN the buffer has a text-compatible filetype supported by the plugin defaults
6 changes: 6 additions & 0 deletions openspec/specs/ordered-list-numbering/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ The plugin SHALL continue alphabetic list markers while preserving case and resp
- WHEN bullet insertion is triggered at the end of the line
- THEN the inserted line uses the next lowercase alphabetic marker

#### Scenario: Alphabetic marker rolls over after z {#OLN-010}

- GIVEN the current line is an alphabetic list item ending near `z`
- WHEN bullet insertion is triggered repeatedly
- THEN the inserted markers roll over to multi-letter alphabetic markers with the same case

#### Scenario: Alphabetic marker length limit {#OLN-006}

- GIVEN the next alphabetic marker would exceed `max_alpha_characters`
Expand Down
36 changes: 36 additions & 0 deletions openspec/specs/outline-nesting/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,42 @@ The plugin SHALL use `outline_levels` to choose marker styles when changing nest
- WHEN demotion is triggered
- THEN the item keeps the last standard marker style at a deeper indentation

#### Scenario: Restart numbering in a new outline {#ON-013}

- GIVEN a second outline starts after an empty separator
- WHEN a child item is inserted in the second outline
- THEN ordered child numbering starts from the first marker for that outline

#### Scenario: Change levels from mixed starting depths {#ON-014}

- GIVEN list items use different starting outline depths and marker styles
- WHEN promotion and demotion are triggered from those items
- THEN each item moves relative to its current outline depth and marker style

#### Scenario: Continue standard markers outside outline levels {#ON-015}

- GIVEN standard unordered markers are enabled but not listed in `outline_levels`
- WHEN a standard marker is continued and then promoted
- THEN continuation preserves the standard marker and promotion uses the configured parent outline level

#### Scenario: Insert nested ordered outline sequence {#ON-016}

- GIVEN a list item is continued while repeatedly changing outline levels
- WHEN inserted items move through configured ordered outline styles
- THEN numeric, alphabetic, and roman markers increment correctly at each depth

#### Scenario: Change complex visual ranges {#ON-017}

- GIVEN a visual range contains list items, wrapped lines, and different indentation depths
- WHEN visual promotion or demotion is triggered
- THEN only recognized list items change to the appropriate outline level

#### Scenario: Preserve line spacing when changing nested bullets {#ON-018}

- GIVEN configured line spacing inserts blank separator lines
- WHEN nested bullets are continued and demoted around wrapped lines
- THEN blank spacing and wrapped-line indentation are preserved

### Requirement: Change visual ranges

The plugin SHALL promote or demote every list item in a visual range.
Expand Down
20 changes: 11 additions & 9 deletions test/alphabetic_bullets_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,27 @@ describe('Bullets.vim', function()
}, helpers.get_lines())
end)

pending('adds a new bullet and loops at z', function()
it('adds a new bullet and loops at z #OLN-010', function()
require('bullets').setup { renumber_on_change = false }
helpers.new_buffer {
'# Hello there',
'y. this is the first bullet',
}
-- Type through "third bullet", then press CR twice:
-- first CR inserts "ab. " (next bullet after "aa."),
-- second CR on empty bullet line triggers delete-last-bullet-if-empty,
-- leaving an empty line in normal mode.
helpers.feedkeys 'A<CR>second bullet<CR>third bullet<CR><CR>'
-- Now in normal mode on empty line 5. Use 'A' to enter insert at end,
-- type the override bullet, then continue with remaining bullets.
helpers.feedkeys 'AAY. fourth bullet<CR>fifth bullet<CR>sixth bullet<Esc>'
helpers.feedkeys 'A<CR>second bullet<CR>third bullet<Esc>'
assert.are.same({
'# Hello there',
'y. this is the first bullet',
'z. second bullet',
'aa. third bullet',
}, helpers.get_lines())

helpers.new_buffer {
'# Hello there',
'AY. fourth bullet',
}
helpers.feedkeys 'A<CR>fifth bullet<CR>sixth bullet<Esc>'
assert.are.same({
'# Hello there',
'AY. fourth bullet',
'AZ. fifth bullet',
'BA. sixth bullet',
Expand Down
7 changes: 3 additions & 4 deletions test/filetypes_spec.lua
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
local helpers = require 'test.helpers'

describe('filetypes', function()
pending('creates mapping for bullets on empty buffer if configured', function()
-- g:bullets_enable_in_empty_buffers defaults to 0, so a new buffer with
-- no filetype does NOT get the bullet <CR> mapping.
it('does not create mapping for bullets on empty buffer by default #ACT-006', function()
require('bullets').setup { enable_in_empty_buffers = false }
vim.cmd 'enew'
vim.cmd 'setlocal formatoptions= comments=' -- prevent '#' comment-continuation
helpers.feedkeys 'i# Hello there<CR>- this is the first bullet<CR>this is the second bullet<Esc>'
assert.are.same({ '# Hello there', '- this is the first bullet', 'this is the second bullet' }, helpers.get_lines())
end)

pending('should have text filetype for .txt', function()
it('should have a text-compatible filetype for .txt #ACT-007', function()
local tmpfile = vim.fn.tempname() .. '.txt'
vim.cmd('edit ' .. tmpfile)
local ft = vim.bo.filetype
Expand Down
Loading