-
Notifications
You must be signed in to change notification settings - Fork 644
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
GUACAMOLE-1632: Have spaces written in the appended clipboard. #404
Conversation
… appended clipboard."
Add end of line identification when writing to the clipboard, avoiding converted spaces.
Add end of line identification when writing to the clipboard, avoiding converted spaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* Keep consistency with vim display */ | ||
if (codepoint == 0) | ||
codepoint = 32; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Certainly this isn't a workaround for some vim-specific behavior, but rather a missing aspect of the correct way for a terminal emulator to behave? Can you rephrase to capture the nature of what's being done here?
src/terminal/select.c
Outdated
int j = end; | ||
while((!buffer_row->characters[j].value)&& (j > start)){ | ||
j--; | ||
} | ||
if(j != start) | ||
end = j; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without any comments/documentation here, it's pretty unclear what the intent or purpose of this block of code is. Can you clarify?
src/terminal/select.c
Outdated
while((!buffer_row->characters[j].value)&& (j > start)){ | ||
j--; | ||
} | ||
if(j != start) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To match the style of established code, please:
- Include a space between
while
/if
and the opening paren. - Include spaces around binary operators like
&&
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I'll mark some annotations on it and re-format. After investigating we assume that this problem is due to both vim specific behavior and guaca's display & copy logic.
The function of annotated blocks is to ignore any spaces or null chars after a line ends when copying multiple lines after selection. This simple logic gives extra spaces if user select what identified as null in simulator. Thus keeps the clipboard consistent with what user sees in simulator.
Closed by #523. |
Add end of line identification when writing to the clipboard, avoiding converted spaces.