mirror of
https://github.com/inkarkat/vim-ingo-library.git
synced 2026-10-07 17:49:17 +02:00
I've discovered an alternative implementation in AdvancedJoiners#QueryJoin#JoinLines() that considered some corner cases that this one would not handle, but the overall implementation is cleaner (and newer) in here. Therefore, add test coverage and port the fixes over to here, and make it correct.
32 lines
1.0 KiB
VimL
32 lines
1.0 KiB
VimL
" Test joining of lines with trailing whitespace and indentation.
|
|
|
|
call append(0, ['4space ', ' trailing and indented'])
|
|
call ingo#join#Lines(1, 1, '')
|
|
|
|
call append(0, ["tab\t", "\ttrailing and indented"])
|
|
call ingo#join#Lines(1, 1, '')
|
|
|
|
call append(0, ['softtabstop ', " \t trailing and indented"])
|
|
call ingo#join#Lines(1, 1, '')
|
|
|
|
call append(0, ['4space ', ' trailing and indented with space separator'])
|
|
call ingo#join#Lines(1, 1, ' ')
|
|
|
|
call append(0, ["tab\t", "\ttrailing and indented with space separator"])
|
|
call ingo#join#Lines(1, 1, ' ')
|
|
|
|
call append(0, ['softtabstop ', " \t trailing and indented with space separator"])
|
|
call ingo#join#Lines(1, 1, ' ')
|
|
|
|
call append(0, ['4space ', ' trailing and indented with ;; separator'])
|
|
call ingo#join#Lines(1, 1, ';;')
|
|
|
|
call append(0, ["tab\t", "\ttrailing and indented with ;; separator"])
|
|
call ingo#join#Lines(1, 1, ';;')
|
|
|
|
call append(0, ['softtabstop ', " \t trailing and indented with ;; separator"])
|
|
call ingo#join#Lines(1, 1, ';;')
|
|
|
|
call vimtest#SaveOut()
|
|
call vimtest#Quit()
|