summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbreadcat2018-04-26 11:16:20 +0100
committerbreadcat2018-04-26 11:16:20 +0100
commit9d306241cee1ff710ef50610258f2716207ec1ae (patch)
treef5004a3dc446866d58abe9c8a6a23001a7395aff
parent90407d6486bb6f0433f8a7c0164c085a7734abbd (diff)
downloadahka-9d306241cee1ff710ef50610258f2716207ec1ae.tar.gz
ahka-9d306241cee1ff710ef50610258f2716207ec1ae.tar.bz2
ahka-9d306241cee1ff710ef50610258f2716207ec1ae.zip
Revert pasteClipboard()
Regex method was a little over-enthusiastic.
-rw-r--r--ahk-assistant.ahk10
1 files changed, 7 insertions, 3 deletions
diff --git a/ahk-assistant.ahk b/ahk-assistant.ahk
index 124f8f1..f14bba1 100644
--- a/ahk-assistant.ahk
+++ b/ahk-assistant.ahk
@@ -601,9 +601,13 @@ appendClipboard() {
}
pasteClipboard() { ; manually paste clipboard, minus most formatting
- pastedClipboard := RegExReplace(clipboard, "[\W_]+") ; remove underscores, non-numbers and non-letters
- SendRaw %pastedClipboard%
- pastedClipboard :=
+ StringReplace, clipboard, clipboard, ?,, All ; remove bullet points
+ StringReplace, clipboard, clipboard, ·,, All ; remove middots
+ StringReplace, clipboard, clipboard, %A_Tab%,, All ; remove tabs
+ StringReplace, clipboard, clipboard, `r,, All ; remove half of line breaks
+ StringReplace, clipboard, clipboard, `n,, All ; remove other half of line breaks
+ clipboard = %clipboard% ; trim whitespace
+ SendRaw %clipboard%
Return
}