Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escape [[ .. ]] to allow those to be used as text not as plugin #162

Closed
lintalist opened this issue Apr 8, 2020 · 2 comments
Closed

Escape [[ .. ]] to allow those to be used as text not as plugin #162

lintalist opened this issue Apr 8, 2020 · 2 comments
Assignees
Milestone

Comments

@lintalist
Copy link
Owner

Introduce escape notation for [[ and ]] to bypass the contents in between those markers to be interpreted as plugin/function.

Possibly use \[\[hello\]\]

Ref. https://twitter.com/yonibee/status/1247605109313482753

@lintalist
Copy link
Owner Author

lintalist commented Apr 8, 2020

Edit: now builtin to v1.9.12
Work around for now: use a script with [[llpart1]] and a StrReplace()

Part 1:

My test with normal [hello]...

Script:

#NoEnv
#SingleInstance, force
SetBatchLines, -1
ListLines, off
LLInit()                            ; fake call to load global variables from Lintalist main script - see Docs
ClipSet("s",1,SendMethod,Clipboard) ; store current clipboard contents
ClearClipboard()                    ; clear it
[[llpart1]]

clipboard:=StrReplace(llpart1,"[hello]","[[hello]]")

Sleep 100
SendKey(SendMethod, ShortcutPaste)  ; paste changed clipboard using SendMethod defined by Lintalist settings
Clipboard:=ClipSet("g",1)           ; restore original clipboard contents
ExitApp

@lintalist lintalist self-assigned this Apr 11, 2020
@lintalist
Copy link
Owner Author

Additionally we may also want to use [,] and | as option content which currently isn't possible due to the method used to parse plugins and options, so:

To escape [,], and | in the options of a plugin, use: <SB, >SB, and ^SB. See ParseEscaped in settings.ini to change this.

Example snippet

[list]
[[selected=wrap|<SB*>SB ]]
[/list]

just before pasting the snippet <SB and >SB will be replaced with [ and ] respectively resulting in:

[list]
[*] selected line 1
[*] selected line 2
[*] ...
[/list]

@lintalist lintalist added this to the 1.9.12 milestone Apr 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant