Skip to content

Commit 14b449f

Browse files
authored
Merge branch 'master' into renovate/configure
2 parents a0b2231 + 4ed0785 commit 14b449f

2 files changed

Lines changed: 29 additions & 1 deletion

File tree

plugin/bullets.vim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,8 @@ command! InsertNewBullet call <SID>insert_new_bullet()
585585
" Helper for Colon Indent
586586
" returns 1 if current line ends in a colon, else 0
587587
fun! s:line_ends_in_colon(lnum)
588-
return getline(a:lnum)[strlen(getline(a:lnum))-1:] ==# ':'
588+
let l:last_char_nr = strgetchar(getline(a:lnum), strcharlen(getline(a:lnum))-1)
589+
return l:last_char_nr == 65306 || l:last_char_nr == 58
589590
endfun
590591
" --------------------------------------------------------- }}}
591592

spec/nested_bullets_spec.rb

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,33 @@
593593
\ti. this bullet is indented
594594
\tii. this bullet is also indented
595595
TEXT
596+
597+
write_file(filename, <<-TEXT)
598+
# Hello there
599+
a. this is the first bullet
600+
TEXT
601+
602+
vim.command 'let g:bullets_auto_indent_after_colon = 1'
603+
vim.edit filename
604+
vim.feedkeys '\<ESC>'
605+
vim.type 'GA'
606+
vim.feedkeys '\<cr>'
607+
vim.type 'this is the second bullet that ends with fullwidth colon:'
608+
vim.feedkeys '\<cr>'
609+
vim.type 'this bullet is indented'
610+
vim.feedkeys '\<cr>'
611+
vim.type 'this bullet is also indented'
612+
vim.write
613+
614+
file_contents = IO.read(filename)
615+
616+
expect(file_contents.strip).to eq normalize_string_indent(<<-TEXT)
617+
# Hello there
618+
a. this is the first bullet
619+
b. this is the second bullet that ends with fullwidth colon:
620+
\ti. this bullet is indented
621+
\tii. this bullet is also indented
622+
TEXT
596623
end
597624
end
598625
end

0 commit comments

Comments
 (0)