how to add ** mark surround to the selection

Post Reply
SamC
Posts: 207
Joined: 12.08.2023 00:49

how to add ** mark surround to the selection

Post by SamC »

Hello,
For '' and () pairs,if we selection certain text and type it, the paris will be added to surround the text.
Can I define new pairs like ** **(for markdown bold)to use as the ()pairs?
Thanks!
main Alexey
Posts: 2245
Joined: 25.08.2021 18:15

Re: how to add ** mark surround to the selection

Post by main Alexey »

No, this should be coded as plugin. Plugin 'Markdown Editing' is a good place for this code.
main Alexey
Posts: 2245
Joined: 25.08.2021 18:15

Re: how to add ** mark surround to the selection

Post by main Alexey »

oh, 'Markdown Editing' already has this code: on typing *, selection is surrounded with * and then with **.
the same - for _ chars.
SamC
Posts: 207
Joined: 12.08.2023 00:49

Re: how to add ** mark surround to the selection

Post by SamC »

I find the description below in Markdown Editing plugin,but it doesn't work. The selection will be deleted and ** is then added. Somewhere to set an option?


"Plugin for CudaText.
Supports features during editing of Markdown documents.

Symbols *_` (asterisk, underscore, tick)
- auto-paired on typing
- if they are typed with selected text, selection is enclosed in symbols pair
- with pair of symbols, and BackSpace pressed - both symbols are deleted
- with pair of symbols, and Space pressed - right symbol is deleted"
main Alexey
Posts: 2245
Joined: 25.08.2021 18:15

Re: how to add ** mark surround to the selection

Post by main Alexey »

1. do you see it on _clean_ CudaText (with only MarkdownEditing)?
2. surrounding works for me, even for multiline selection. my plugin config settings/plugins/plugins.ini has:

Code: Select all

[markdown_editing]
list_indent_bullets=*+-
match_header_hashes=0
paired_chars="*~`
SamC
Posts: 207
Joined: 12.08.2023 00:49

Re: how to add ** mark surround to the selection

Post by SamC »

Tried with clean CudaText,
with Markdown Editing plugin:** will be added and the selection is deleted.
without Markdown Editing plugin:* is added and the selection is deleted.
windows10 is used.
main Alexey
Posts: 2245
Joined: 25.08.2021 18:15

Re: how to add ** mark surround to the selection

Post by main Alexey »

Did you try to do it _with Markdown lexer active_ (and plugin installed)? seems no.
SamC
Posts: 207
Joined: 12.08.2023 00:49

Re: how to add ** mark surround to the selection

Post by SamC »

Markdown lexer active is on.
I find it works with the * mark on main keyboard.
But didn't work for the * mark on keypad.(selection will be delete)
main Alexey
Posts: 2245
Joined: 25.08.2021 18:15

Re: how to add ** mark surround to the selection

Post by main Alexey »

reproduced it, thanks. fixed. plugin is updated. try again.
SamC
Posts: 207
Joined: 12.08.2023 00:49

Re: how to add ** mark surround to the selection

Post by SamC »

It works now,Thanks!
Post Reply