From 50b3b01a33712be77ef953654fce95f141cc2982 Mon Sep 17 00:00:00 2001 From: Ryan Carney Date: Wed, 11 Nov 2015 21:29:18 -0800 Subject: [PATCH 1/2] fix mapping to table sort Symptom: when trying to sort a column using ts the following error would be displayed: E119: Not enough arguments for function: tablemode#spreadsheet#Sort Problem: Function call tablemode#spreadsheet#Sort() was missing a arguemnts for it's named parameter bang. Solution: Add a blank value of '' as the argument for the bang parameter ---- Related Issues: #38 --- plugin/table-mode.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/table-mode.vim b/plugin/table-mode.vim index aa504e9..3e78186 100644 --- a/plugin/table-mode.vim +++ b/plugin/table-mode.vim @@ -108,7 +108,7 @@ nnoremap (table-mode-eval-formula) :call tablemode#spreadsheet#fo nnoremap (table-mode-echo-cell) :call TableEchoCell() -nnoremap (table-mode-sort) :call tablemode#spreadsheet#Sort() +nnoremap (table-mode-sort) :call tablemode#spreadsheet#Sort('') if !hasmapto('(table-mode-tableize)') exec "nmap " . g:table_mode_map_prefix . "t (table-mode-tableize)" From 68720248276c581c97c630005f06791e8b290c31 Mon Sep 17 00:00:00 2001 From: Ryan Carney Date: Wed, 11 Nov 2015 21:30:04 -0800 Subject: [PATCH 2/2] add docs for table sorting command and mapping ---- Related Issues: #38 --- doc/table-mode.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/table-mode.txt b/doc/table-mode.txt index 3b83ec1..35b730d 100644 --- a/doc/table-mode.txt +++ b/doc/table-mode.txt @@ -349,6 +349,10 @@ MAPPINGS *table-mode-mappings* would evaluate the formula line and update the table accordingly. This invokes the |TableEvalFormulaLine| command. + + *table-mode-mappings-sort-column* +ts Sort a column under the cursor. This invokes *TableSort* + || Expands to a header border. You can change this by changing |table-mode-separator| option. You can change the character to be used for te extreme corners of the border by changing @@ -416,6 +420,14 @@ COMMANDS *table-mode-commands* This command when invoked from anywhere within the table or directly on the formula line evaluates it and updates the table accordingly. + *:TableSort* + *table-mode-:TableSort* +:TableSort[!] [i][u][r][n][x][o] + This command sorts column under the cursor and inherits the same flags + as the *:sort* command. + + With [!] the order is reversed. + =============================================================================== CONTRIBUTING *table-mode-contributing*