Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; TOGGLE BLOCK COMMENT CODE
- ; Ref: https://stackoverflow.com/questions/20009502/autohotkey-code-block-comment-and-uncomment-hotkeys
- ^+/::
- clipsaved := Clipboard
- Clipboard :=
- Send ^c
- Sleep 40
- text := Clipboard
- if (text != "")
- {
- if Instr(text, "/*")
- {
- ; Remove block comment signatures /**/
- text := StrReplace(text, "/*")
- text := StrReplace(text, "*/")
- Clipboard := text
- }
- else
- {
- ; Add block comment signatures /**/
- if InStr(text, "`r`n")
- Clipboard := "/*`r`n" + text + "`r`n"
- else
- Clipboard := "/*" + text "*/"
- }
- Clipboard := Clipboard ; For somewhere Clipboard conflict
- Send ^v
- }
- Clipboard := clipsaved
- return
Add Comment
Please, Sign In to add comment