From bb4fe07722676c04d0bd29b8265327da29d9997c Mon Sep 17 00:00:00 2001 From: VG Date: Fri, 24 Jul 2015 17:38:46 +0200 Subject: Remove vim_bridge dependency again but from the right place. --- ftplugin/rst_tables.vim | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/ftplugin/rst_tables.vim b/ftplugin/rst_tables.vim index 6c994ce..be45597 100644 --- a/ftplugin/rst_tables.vim +++ b/ftplugin/rst_tables.vim @@ -22,7 +22,6 @@ import re import textwrap import unicodedata import codecs -from vim_bridge import bridged def get_table_bounds(): @@ -285,39 +284,37 @@ def draw_table(indent, table, manual_widths=None): return output -@bridged def reformat_table(): upper, lower, indent = get_table_bounds() encoding = vim.eval("&encoding") slice = map(lambda x: codecs.decode(x, encoding), \ - vim.current.buffer[upper - 1:lower]) + vim.current.buffer[upper - 1:lower]) table = parse_table(slice) slice = draw_table(indent, table) vim.current.buffer[upper - 1:lower] = map(lambda x: \ - codecs.encode(x, encoding), slice) + codecs.encode(x, encoding), slice) -@bridged def reflow_table(): upper, lower, indent = get_table_bounds() encoding = vim.eval("&encoding") slice = map(lambda x: codecs.decode(x, encoding), \ - vim.current.buffer[upper - 1:lower]) + 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] = map(lambda x: \ - codecs.encode(x, encoding), slice) + codecs.encode(x, encoding), slice) endpython " Add mappings, unless the user didn't want this. " The default mapping is registered, unless the user remapped it already. if !exists("no_plugin_maps") && !exists("no_rst_table_maps") - if !hasmapto('ReformatTable(') - noremap c :call ReformatTable() + if !hasmapto(' reformat_table(') + noremap c :python reformat_table() endif - if !hasmapto('ReflowTable(') - noremap f :call ReflowTable() + if !hasmapto(' reflow_table(') + noremap f :python reflow_table() endif endif -- cgit v1.2.3