From c0d8d5fe05b095fd63231dbe808a11ed764fd8a6 Mon Sep 17 00:00:00 2001 From: Christophe Courtaut Date: Wed, 14 Aug 2013 11:42:49 +0200 Subject: Add check to be able to create a top page table This commit adds a check for top boundary, so if the table goes up to the top of the document, it will be correctly detected. --- ftplugin/rst_tables.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ftplugin/rst_tables.vim b/ftplugin/rst_tables.vim index f17eba2..4b4ebb7 100644 --- a/ftplugin/rst_tables.vim +++ b/ftplugin/rst_tables.vim @@ -28,7 +28,7 @@ def get_table_bounds(): row, col = vim.current.window.cursor upper = lower = row try: - while vim.current.buffer[upper - 1].strip(): + while vim.current.buffer[upper - 1].strip() and upper > 0: upper -= 1 except IndexError: pass -- cgit v1.2.3