Page 1 of 1

how to add ** mark surround to the selection

Posted: 16.12.2023 09:25
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!

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

Posted: 16.12.2023 09:38
by main Alexey
No, this should be coded as plugin. Plugin 'Markdown Editing' is a good place for this code.

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

Posted: 16.12.2023 09:39
by main Alexey
oh, 'Markdown Editing' already has this code: on typing *, selection is surrounded with * and then with **.
the same - for _ chars.

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

Posted: 16.12.2023 10:34
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"

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

Posted: 16.12.2023 10:40
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="*~`

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

Posted: 16.12.2023 11:03
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.

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

Posted: 16.12.2023 11:07
by main Alexey
Did you try to do it _with Markdown lexer active_ (and plugin installed)? seems no.

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

Posted: 16.12.2023 11:12
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)

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

Posted: 16.12.2023 11:23
by main Alexey
reproduced it, thanks. fixed. plugin is updated. try again.

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

Posted: 16.12.2023 14:25
by SamC
It works now,Thanks!