Rename or preferably split `Auto pair Markdown syntax`

Steps to reproduce

  1. Toggle on ‘Auto pair Markdown syntax’ in Editor settings
  2. Select a word in editor and type *. (word becomes italicized)
  3. Toggle off ‘Auto pair Markdown syntax’ in Editor settings
  4. Select another word in editor and type *. (word is overwritten)

Expected result

My selected text becomes italicized (or bold, highlighted, etc.).

Actual result

My selected text is overwritten.

Environment

  • Operating system: MacOS
  • Obsidian version: 0.8.14

Additional information

This pertains to two related, but separate, features of the editor: 1) auto-pairing markdown syntax when user starts typing markdown, 2) applying markdown to user-selected text.

I want to use #2 but disable #1. But one toggle setting controls the two distinct features.

One solution would be to de-couple these into 2 different settings. Another would be just let #2 be the default, with no setting. I can’t think of a reason someone would want to disable #2 at the moment.

Note: an identical bug exists for the ‘Auto pair brackets’ setting and typing [ to apply linking to a text selection. But I’ll just submit this one report for both bugs.

2 Likes

Another solution would be to give the toggle a more inclusive name.

That would be a solution if the bug report were about a poorly named setting.

I’m claiming it’s a bug that this setting conflates two separate editor features and disables desirable functionality.

anyway, this sound more like a feature request than a bug report. we’ll think about it.

1 Like

I considered making a Feature Request but landed on bug report because

  1. It’s about an already implemented feature.
  2. It’s unexpectedly disabled by a toggle setting for a separate feature.
  3. I couldn’t think of a reason a user would desire the feature to ever be disabled.

Just to provide some context - the reasoning that it’s done this way is because the editor we use (CodeMirror) exposes this functionality as a single configuration, and long ago we didn’t even have the choice of only pairing when selecting; it must be either autopair both while typing and while selecting.

I made some tweaks to CodeMirror’s internals to achieve the pairing effect only on selection for $ and = but we didn’t think of splitting the functionality because of that.

2 Likes

Kudos @Licat to take the time to clearly explain decisions like this.
The Obsidian community rocks!

1 Like