Fix bbox outside the first column (consider &tw)

This commit is contained in:
mMontu 2015-03-12 09:20:54 -03:00
parent 93d5c015bb
commit a83b3db1b3

View File

@ -89,7 +89,8 @@ endsnippet
snippet bbox "A nice box over the full width" b snippet bbox "A nice box over the full width" b
`!p `!p
width = int(vim.eval("&textwidth")) or 71 if not snip.c:
width = int(vim.eval("&textwidth - (virtcol('.') == 1 ? 0 : virtcol('.'))")) or 71
box = make_box(len(t[1]), width) box = make_box(len(t[1]), width)
snip.rv = box[0] snip.rv = box[0]
snip += box[1] snip += box[1]