Example #1
0
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
Example #2
0
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())
Example #5
0
 def testGetBoundsOnEndOfFile(self):
     self.load_fixture_in_vim('default')
     vim.current.window.cursor = (8, 0)
     self.assertEquals((8, 9), get_table_bounds())
Example #6
0
 def testGetBounds(self):
     self.load_fixture_in_vim('default')
     self.assertEquals((3, 6), get_table_bounds())
Example #7
0
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
Example #8
0
 def testGetBoundsOnBeginOfFile(self):
     self.load_fixture_in_vim('default')
     vim.current.window.cursor = (1, 0)
     self.assertEqual((1, 1, ''), get_table_bounds())
Example #9
0
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