Fixes#86
This allows the formula line to be evaluated, even if there is a single
empty line after the table. The "empty" line is allowed to contain
whitespace, but nothing else.
The formula will evaluate if triggered on the table, the empty line, or
the formula lines.
* Does not try to forcefully cast column content to float
* Silences any errors during formula evaluation, you can look at
`v:errmsg` to see if there was any error during the evaluation for
debugging
fixed a Vim error(E907) in Min/Max when comparing v:null to a float
fixed CountE/CountNE/PercentE/PercentNE to support spanning rows/columns
added test cases for all the new formula functions
- Min: get the lowest value
- Max: get the highest value
- CountE: count the number of empty cells
- CountNE: count the number of non-empty cells
- PercentE: percent of empty cells
- PercentNE: percent of non-empty cells
- AverageNE: average over non-empty cells
Also added a subtle tweak that ignores an HTML comment tag ('<!--')
found between the table and the starting formula line. Being able to
wrap all the formula lines with an HTML comment prevents the formulas
from being rendered in Markdown/ReST output.
If a g:table_mode_separator is escaped by a backslash, the table is
aligned ignoring this instance of the g:table_mode_separator, but the
column deletion and insertion functions did not consider this behaviour.
The g:table_mode_escaped_separator regex is simplified and optimized a
little bit. Also more care is taken to prevent unexpected behaviour if
special characters are used as g:table_mode_separator.
Readme mentions settings for Markdown and ReST, but we can apply them
automatically for the current filetype. If a user is editing a no
filetype scratch buffer, they'll still need to configure these options
themselves. But this provides better defaults when editing a buffer of
these filetypes.
Adds get_buffer_or_global_option that could be used for any other
buffer-local (filetype-specific) options.
Fixes#45.
Require our end expr to insert a border. This prevents borders from
clobbering other text and makes it possible to use visual block to insert
a new column.
Initial support. Alignment and border creation is fixed and is
consistent in considering the escaped table separator as part of the
column.
TODO :
* Fix syntax to reflect the above.
* Fix cell definition, motion & formula engine to incorporate this.
In order to use vim table mode over vimwiki native table formatting
support you need to add the following vimwiki settings to your vimrc :
```vim
let g:vimwiki_table_mappings=0
let g:vimwiki_table_auto_fmt=0
```
Since realigning doesn't work well in insert mode, I have removed auto
align feature for it. Auto align will now kick in once you have made
changes and get back to normal mode.
This is for better experience with auto align, we override the
updatetime with the value of the configuration g:table_mode_update_time.
Once table mode is disabled prior defaults are restored.