Previously vimwiki#tbl#get_cells() would act on `line` as a normal string (i.e. using `[idx]` and strpart()). This breaks when the column separator (s:s_rep() or rxTableSep) is a multibyte character like the vertical box drawing character │. In that case the separator is never found and only one empty cell is returned. This also affects vimwiki#tbl#format() which in turn clears the whole table each time the insert mode is left. Fix this issue by initially splitting the line into a list of the characters. Getting the elements with `[idx]` now returns each character instead of a byte. In addition len() is used in place of strlen() as well as slicing together with join() instead of strpart(). Fixes: #1297 ("Table formatting breaks on multibyte separator")
This commit is contained in:
@@ -4002,9 +4002,11 @@ Contributors and their Github usernames in roughly chronological order:
|
||||
- Thomas Leyh (@leyhline)
|
||||
- nebulaeandstars (@nebulaeandstars)
|
||||
- dmitry kim (@jsn)
|
||||
- Julian Prein (@druckdev)
|
||||
- Luke Atkinson (@LukeDAtkinson)
|
||||
- Joe Planisky (@jplanisky)
|
||||
|
||||
|
||||
==============================================================================
|
||||
16. Changelog *vimwiki-changelog*
|
||||
|
||||
|
||||
Reference in New Issue
Block a user