Skip to content

Multi line Enhancements

Kevin Quick edited this page Feb 12, 2019 · 2 revisions

Code Blocks

Multi-line editing mode is distinct from single-line editing mode, and it is pretty much essential to creating a post with a code block (starting with triple-backquotes). In addition, editing a code block has enough variation between what's typed and what's shown that it's often very helpful to be able to see what will be shown (i.e. preview mode).

The current thinking is to make the following changes. These have been discussed a bit and can be re-considered if desired, but the intent here is mostly to document the overall intended changes before creating actual individual actionable issues for them.

  1. If the current input begins with triple-backquotes, auto-enable multi-line editing mode. a. If allowed by a configuration parameter, which defaults to false so as not to surprise the user. b. Applies to the current message only, reverting to normal (single-line editing mode) after disposition of this message.

  2. If the current input begins with triple-backquotes, auto-enable preview mode. a. If allowed by a configuration parameter, which defaults to false so as not to surprise the user. b. M-p should still allow enable/disable of preview mode.

  3. Add a key (proposed: C-p) which posts the current message in both single- and multi-line edit modes. a. For single-line edit mode, this duplicates the funcitonality of hitting Enter. b. For multi-line edit mode, this is an alternative to hitting M-e to get the prompt and then hitting Enter to send. The advantage of this is that the user can develop muscle memory for this keypress which has the same effect in all entry modes, whereas the functionality of the Enter key changes between these 3 modes (considering the post-multiline-entry prompt as a mode unto itself).

  4. Add a key (proposed: C-c) to cancel sending the current message and return to a blank, single-line entry mode. This key works the same in both single-line entry mode and multi-line entry mode to provide similar advantages to #3 above.

  5. In multi-line entry mode, Esc will return to single-line entry mode as long as there is no more than one line of input entered (similar to hitting M-e in multi-line mode under the same conditions). This makes Esc provide similar functionality to the other modes as long as it is unambiguous regarding the subject matter.

Slash Commands

  • For most slash commands (e.g. /create-channel, /flags, etc.) it does not make any sense to allow multi-line editing mode.
  • For some slash commands (e.g. /msg) a multi-line editing mode can be supported, but it should be adjusted to minimize confusion (e.g. if one of the following lines happens to start with a /, it should be clear that is not a command).
    • Use special highlighting for recognized / commands at the beginning of the first line; no highlighting of these if they appear elsewhere?
    • When entering multi-line edit mode with a "/msg @user", Remove that part and put it in the prompt box for the multi-line edit mode?
  • Investigate for other potential issues.
Clone this wiki locally