aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Courtaut <christophe.courtaut@gmail.com>2013-08-14 11:42:49 +0200
committerChristophe Courtaut <christophe.courtaut@gmail.com>2013-08-14 11:42:49 +0200
commitc0d8d5fe05b095fd63231dbe808a11ed764fd8a6 (patch)
tree3755db0517b88cd290ed9e798fd50a0fdaafde33
parent72bb0d5b872b8963860a47dd06c4e654270e9589 (diff)
downloadvim-rst-tables-c0d8d5fe05b095fd63231dbe808a11ed764fd8a6.tar.gz
vim-rst-tables-c0d8d5fe05b095fd63231dbe808a11ed764fd8a6.tar.bz2
vim-rst-tables-c0d8d5fe05b095fd63231dbe808a11ed764fd8a6.zip
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.
-rw-r--r--ftplugin/rst_tables.vim2
1 files changed, 1 insertions, 1 deletions
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