Skip to content

Commit

Permalink
Fixed copying text to clipboard.
Browse files Browse the repository at this point in the history
Clink was putting the actual Unicode text on the clipboard, and for some
reason was also putting empty ANSI text on the clipboard.  It's correct
to omit the ANSI text and just let Windows automatically convert Unicode
text to ANSI text as needed.
  • Loading branch information
chrisant996 committed Feb 24, 2021
1 parent 3e0bbc6 commit e12898f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions clink/lib/src/rl/rl_commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,7 @@ static void copy_impl(const char* value, int length)
if (OpenClipboard(nullptr) == FALSE)
return;

SetClipboardData(CF_TEXT, nullptr);
SetClipboardData(CF_UNICODETEXT, mem);
SetClipboardData(CF_UNICODETEXT, mem); // Windows automatically dynamically converts to CF_TEXT as needed.
CloseClipboard();
}

Expand Down

0 comments on commit e12898f

Please sign in to comment.