Posted August 15, 2021 by billiam
Verion 0.26 brings a shiny new table editor to Deepdwn!
Tables are realigned automatically while editing. You can press tab (and shift tab) to jump between columns, or press enter to move to the next row.
You can find the shortcuts for adding, removing, sorting, and moving columns and rows here: Shortcuts. Most of these are also available when using vim or emacs shortcuts as well.
In addition to the more explicit shortcuts above, new columns can be added by typing a pipe character ( |
) in an existing table cell.
Similarly, you can delete a pipe character if the column before that character is empty (not counting the header), and the entire column will be removed.
When Deepdwn adds spaces to pad out column widths, CJK (Chinese, Japanese and Korean) characters will be treated as exactly twice the width of latin characters.
There are some fonts, too large to include with Deepdwn, where latin characters are exactly half the width relative of CJK characters, such as Sarasa Mono. If you install one of these and use it as your editor font in Deepdwn, your tables will line up perfectly, even with a mix of CJK and non-CJK characters.
Sarasa Term UI shown:
Tables can either have pipe characters at the start and end of each line (“closed” tables), or they can be “open”, where each line does not start and end with a pipe.
Here’s a closed table:
| heading | heading |
|---------|---------|
| hello | hello |
and an open table:
heading | heading
--------|--------
hello | hello
Because of markdown formatting rules, open tables are slightly more compact, but aren’t quite as flexible. Closed tables are required if any cells in the first column are empty, for instance. Closed tables can also be a single column wide, where open tables must have at least two columns.
You can toggle between open and closed table formatting styles by adding (or removing) a pipe character at the very beginning of the table.
There may be times when you don’t want to automatically reformat tables while editing them, perhaps because the alignment causes wrapping in your editor.
You can disable automatic table formatting in Preferences > Input
. When table formatting is disabled, you may still use all of the table editing shortcut keys to edit and format tables.
I’m planning to continue improving table editing in Deepdwn incrementally, so please report issues and annoyances that you find to the support or feature discussion boards (as appropriate).
This update also has a few (mostly) visual tweaks for typewriter mode