Commit Graph

9 Commits

Author SHA1 Message Date
Dhruva Sagar
a3aba5100e Fixed Tableize indentation issue
When applying Tableize on an indented code, the table was created
however the indentation was lost in the process. Earlier the function
s:ConvertDelimiterToSeparator(line) was replace the ^ (start of line),
the g:table_mode_delimiter and $ (end of line) with
g:table_mode_separator and then processing each line for creation of the
table around it, hence since the start of line was replaced it was
causing the indentation to be lost. Fixed this by replacing ^\s*\zs\ze.
(matches just before the first non-blank character) along with
g:table_mode_delimiter and $ and hence the indentation is preserved.
2013-03-18 17:57:14 +05:30
Dhruva Sagar
12700a2a3b Updated UpdateLineBorder function
Rather than get a variable number of arguments to make it optional I now
require one argument, the line number to operate on for the function
UpdateLineBorder. Makes sense to be this way.

Also improved some conditionals for better readability.
2013-03-18 17:55:01 +05:30
Dhruva Sagar
8169303d40 Added helpful comment for magic within TableizeRange 2013-03-18 17:20:17 +05:30
Dhruva Sagar
c94b91237e Added s:strlen for counting multibyte characters
Check :h strlen() for more details with regards to counting multibyte
characters accurately.
2013-03-18 17:06:15 +05:30
Dhruva Sagar
674f3e376c Removed unnecessary check 2013-03-18 16:11:31 +05:30
Dhruva Sagar
5defaa10e4 Fixed ConvertDelimiterToSeparator
- We now aggressively add separators to a line even if it does not have
  the g:table_mode_delimiter. If the user calls Tableize, we should
  trust the user he wishes to tableize everything. Earlier
  implementation skips & fails for lines in text that did not have the
  g:table_mode_delimiter and hence formed inconsistent tables.

  Everything can be undone with a single 'u' anyways.
2013-03-18 12:19:38 +05:30
Dhruva Sagar
b2ba3caf24 Added Tableize to wrap content into a table.
- Added :Tableize which accepts a range. It checks if the content has a
  delimiter defined by g:table_mode_delimiter and if so, it adds a table
  around it.
- Added <Leader>T mapping, which is defined by g:table_mode_tableize_map
  that applies :Tableize on the visually selected range.
- Added options for tableize.
- Updated vim doc.
2013-03-18 12:10:12 +05:30
Dhruva Sagar
b9eb7a25d5 Added more commands & updated help dpc
- Added :TableModeEnable to explicitly enable & :TableModeDisable to
  explicitly disable the plugin.
2013-03-17 04:37:11 +05:30
Dhruva Sagar
368d32de45 Table Mode v1.0 2013-03-17 03:56:43 +05:30