Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for fullwidth colon ":" #148

Merged
merged 1 commit into from
Apr 18, 2024
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
3 changes: 2 additions & 1 deletion plugin/bullets.vim
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,8 @@ command! InsertNewBullet call <SID>insert_new_bullet()
" Helper for Colon Indent
" returns 1 if current line ends in a colon, else 0
fun! s:line_ends_in_colon(lnum)
return getline(a:lnum)[strlen(getline(a:lnum))-1:] ==# ':'
let l:last_char_nr = strgetchar(getline(a:lnum), strcharlen(getline(a:lnum))-1)
return l:last_char_nr == 65306 || l:last_char_nr == 58
endfun
" --------------------------------------------------------- }}}

Expand Down
27 changes: 27 additions & 0 deletions spec/nested_bullets_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,33 @@
\ti. this bullet is indented
\tii. this bullet is also indented
TEXT

write_file(filename, <<-TEXT)
# Hello there
a. this is the first bullet
TEXT

vim.command 'let g:bullets_auto_indent_after_colon = 1'
vim.edit filename
vim.feedkeys '\<ESC>'
vim.type 'GA'
vim.feedkeys '\<cr>'
vim.type 'this is the second bullet that ends with fullwidth colon:'
vim.feedkeys '\<cr>'
vim.type 'this bullet is indented'
vim.feedkeys '\<cr>'
vim.type 'this bullet is also indented'
vim.write

file_contents = IO.read(filename)

expect(file_contents.strip).to eq normalize_string_indent(<<-TEXT)
# Hello there
a. this is the first bullet
b. this is the second bullet that ends with fullwidth colon:
\ti. this bullet is indented
\tii. this bullet is also indented
TEXT
end
end
end
Loading