def reflow_table(): upper, lower, indent = get_table_bounds() slice = vim.current.buffer[upper - 1:lower] widths = get_column_widths_from_border_spec(slice) table = parse_table(slice) slice = draw_table(indent, table, widths) vim.current.buffer[upper - 1:lower] = slice
def testGetBoundsOnEndOfFile(self): self.load_fixture_in_vim('default') vim.current.window.cursor = (8, 0) self.assertEquals((8, 9), get_table_bounds())
def testGetBounds(self): self.load_fixture_in_vim('default') self.assertEquals((3, 6), get_table_bounds())
def reformat_table(): upper, lower, indent = get_table_bounds() slice = vim.current.buffer[upper - 1:lower] table = parse_table(slice) slice = draw_table(indent, table) vim.current.buffer[upper - 1:lower] = slice
def testGetBoundsOnBeginOfFile(self): self.load_fixture_in_vim('default') vim.current.window.cursor = (1, 0) self.assertEqual((1, 1, ''), get_table_bounds())