Blank Spaces at the End of a Line Have No Marks

I’ve found a possible bug related to text formatting. Let’s assume bold is the mark in this case.

Steps to Reproduce:

  1. Clear all text from the editor.
  2. Type a word, then add one or more blank spaces at the end.
  3. Press Ctrl + Shift + Left to select the word along with the trailing space(s).
  4. Apply bold formatting.
  5. Only the word becomes bold—the trailing space(s) remain unmarked.

Expected Behavior:

The blank spaces should also receive the bold mark, just like when we select only spaces and apply bold formatting.

Let me know if this is the intended behavior or a bug and also a solution.

This is intentional behavior in the toggleMark command. See this thread for context.

Thanks for the quick response.

Could you also suggest an appropriate solution for customizing it for my use-case?

I guess behavior like that should be configurable. This patch adds an option to toggleMark that makes it possible to turn it off.

Thanks for the patch!