Skip to content

Commit

Permalink
When pasting into the addressbar, replace newlines with spaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
gijsbers committed Dec 24, 2023
1 parent c680ce8 commit 8e3daf9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/yinputline.cc
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,13 @@ void YInputLine::handleSelection(const XSelectionEvent &selection) {
YProperty prop(selection.requestor, selection.property,
F8, 32 * 1024, selection.target, True);
if (prop) {
replaceSelection(prop.data<char>(), prop.size());
char* data = prop.data<char>();
int size = int(prop.size());
for (int i = size; 0 < i--; ) {
if (data[i] == '\n')
data[i] = ' ';
}
replaceSelection(data, size);
}
}
}
Expand Down

0 comments on commit 8e3daf9

Please sign in to comment.