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

v1: Backported A_Clipboard from alpha branch. #235

Merged
merged 1 commit into from
Oct 30, 2022

Conversation

jeeswg
Copy link
Contributor

@jeeswg jeeswg commented May 13, 2021

A built-in variable, A_Clipboard, equivalent to the existing built-in variable, Clipboard.
This makes AHK v1 consistent with AHK v2, so that both versions have A_Clipboard.

Test code:

;==================================================

;test A_Clipboard:

;manually: copy image data in MS Paint
vClipSaved := ClipboardAll

A_Clipboard := "abc"
MsgBox, % A_Clipboard "`r`n" Clipboard ;abc
A_Clipboard .= "def"
MsgBox, % A_Clipboard "`r`n" Clipboard ;abcdef

Clipboard := "ghi"
MsgBox, % A_Clipboard "`r`n" Clipboard ;ghi
Clipboard .= "jkl"
MsgBox, % A_Clipboard "`r`n" Clipboard ;ghijkl

A_Clipboard := vClipSaved
;manually: paste image data in MS Paint

;==================================================

@jeeswg jeeswg changed the title v1: Added A_Clipboard. v1: Backported A_Clipboard from alpha branch. Aug 17, 2022
@Lexikos Lexikos merged commit ca09a85 into AutoHotkey:master Oct 30, 2022
@jeeswg
Copy link
Contributor Author

jeeswg commented Nov 7, 2022

A long-standing Clipboard append bug.

I discovered a bug in AHK v1 (since at least AHK 1.0.48.05).
If you select files in Explorer, and press Ctrl+C to copy, and then append text to the clipboard, e.g. Clipboard .= "abc", the resulting string is <<>>abc.

I discovered that the problem was fixed in AHK v2:
AutoHotkey v2.0-a110 had the problem.
AutoHotkey v2.0-a111 didn't.

This may be the relevant commit that fixed it, but it's a massive commit: 9d8f430f.

clipboard.h (currently identical in AHK v1 and v2) contains this line:
return IsClipboardFormatAvailable(CF_HDROP) ? _T("<<>>") : _T("");

(I've tried stepping through AHK v1. I don't expect to find a solution for weeks, due to some code that I'm not familiar with.)

This bug appears to be unrelated to a different bug that was fixed in v2.0-a101: 60d036a0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants