Shortcut to change header level

Shane's Avatar

Shane

10 Oct, 2017 05:50 PM

In a previous version of Multimarkdown Composer (v3 and before, I believe), using the command+right arrow/left arrow shortcuts on a line that is a header would increase or decrease the header level (e.g. # Header becomes ## Header with command+right arrow), rather than change the indentation. Now those shortcuts change the indentation as they do in other contexts.

While this does maintain consistency, it's unlikely that one wants to indent a line which is currently a header (among other reasons because it would no longer be a header), while, one might periodically change the organization of one's writing by promoting or demoting sections. In addition, the keyboard shortcut can be used anywhere on the line, making it faster than moving to the beginning of the line and adding/removing the appropriate number of #'s. Even more so if they are at the beginning and end of the line.

  1. Support Staff 1 Posted by Fletcher on 12 Oct, 2017 02:46 PM

    Fletcher's Avatar

    I'm not sure of the best thing to do here.

    The inconsistent behavior did bother me. Some people do use headers inside lists (I'm not sure why, but that's a separate issue). Can also have comments that start with #, and it's important to be able to indent them in relation to code blocks.

    I'm thinking that maybe a different shortcut might be useful here (and could be used in other situations where appropriate). This would allow indent/outdent to remain consistent (whether called by menu, Cmd-right, or Cmd-]).

    Thoughts?

  2. 2 Posted by Shane on 16 Oct, 2017 07:54 PM

    Shane's Avatar

    I see what you mean about there being cases where people do want to indent what would otherwise be a header (or even use a header in a list, as you said).

    Given that, and wanting to maintain consistency, I agree that different/new keyboard shortcuts would be a good solution.

    I was playing around looking for some options. I think that something with [ and ] or arrows would be good because it would be easier to remember (and have a logical increase and decrease pair). It's tricky, though, because both have lots of keyboard shortcuts already. Still, it looked like Option+Cmd+left/right arrow didn't seem to do anything, at least in my testing. Would that be an option?

    The only other context where I thought that the shortcut could be used was may with subscript/superscript to increase/decrease the height of the highlighted text, but I can imagine that there could be difficult edge cases regarding how to interpret the indent or modify the highlighted text. Though maybe not. Also, the semantics would be different, as I can only imagine it making sense if it worked on selected text, whereas the header shortcut just requires that the cursor be on the appropriate line.

    Thanks.

  3. Support Staff 3 Posted by Fletcher on 31 Oct, 2017 02:47 PM

    Fletcher's Avatar

    The next release will offer a Cmd-{ or Cmd-} alternative to the indent/deindent command that decreases/increases ATX header levels.

    If appropriate I can consider adding other functionality to that command as well.

    I don't think superscript/subscript is a good fit for this -- I think that should stay as is.

    F-

  4. Fletcher closed this discussion on 31 Oct, 2017 02:47 PM.

  5. Shane re-opened this discussion on 31 Oct, 2017 09:25 PM

  6. 4 Posted by Shane on 31 Oct, 2017 09:25 PM

    Shane's Avatar

    That seems like a good set of key combinations. And I'm looking forward to having the shortcut. Thanks!

    And I totally understand about superscript/subscript. It just occurred to me, and I thought I'd mention it. It's not really a good fit, as you said.

    Thanks,
    Shane...

  7. Fletcher closed this discussion on 01 Nov, 2017 12:49 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac