mike-jumper commented on code in PR #404:
URL: https://github.com/apache/guacamole-server/pull/404#discussion_r1029807825
##########
src/terminal/select.c:
##########
@@ -297,6 +297,13 @@ static void
guac_terminal_clipboard_append_row(guac_terminal* terminal,
if (end < 0 || end > buffer_row->length - 1)
end = buffer_row->length - 1;
+ int j = end;
+ while((!buffer_row->characters[j].value)&& (j > start)){
+ j--;
+ }
+ if(j != start)
Review Comment:
To match the style of established code, please:
* Include a space between `while` / `if` and the opening paren.
* Include spaces around binary operators like `&&`.
##########
src/terminal/select.c:
##########
@@ -309,8 +316,12 @@ static void
guac_terminal_clipboard_append_row(guac_terminal* terminal,
int codepoint = buffer_row->characters[i].value;
+ /* Keep consistency with vim display */
+ if (codepoint == 0)
+ codepoint = 32;
Review Comment:
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:
##########
@@ -297,6 +297,13 @@ static void
guac_terminal_clipboard_append_row(guac_terminal* terminal,
if (end < 0 || end > buffer_row->length - 1)
end = buffer_row->length - 1;
+ int j = end;
+ while((!buffer_row->characters[j].value)&& (j > start)){
+ j--;
+ }
+ if(j != start)
+ end = j;
Review Comment:
Without any comments/documentation here, it's pretty unclear what the intent
or purpose of this block of code is. Can you clarify?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]