km-markdown-library icon indicating copy to clipboard operation
km-markdown-library copied to clipboard

more concise way for wrapping selected text

Open haukelicht opened this issue 6 years ago • 0 comments

Hello!

I love to work with your KM macros. Yet, I wonder whether your Make italic (Make bold) and Wrap ... macros could be defined more concisely.

Specifically, I'have experimented with the %|% (Location cursor) token to insert text at the current cursor location (which is where selected text is, when one wants to wrap it in *, **, etc.). I have, for example, defined an alternative action flow to wrap selected text on both ends with asterisks (*) to make it appear italic in markdown (see also attached image):

  1. Execute Macro "Helper - Is text selected?"
  2. Cut to Named Clipboard "Temporary"
  3. Insert Text "%|%%NamedClipboard%Temporary%%|%" by Pasting
  4. Set Named Clipboard to "%Delete%"

This way of making selecting text appears to be faster, since it does not involve waiting times. Are there any caveats to defining the "Make Italic" Macro in this way in your opinion? km_macro_mardown_make_italic

haukelicht avatar Jun 07 '18 20:06 haukelicht