You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@guacamole.apache.org by GitBox <gi...@apache.org> on 2022/11/22 23:00:47 UTC

[GitHub] [guacamole-server] mike-jumper commented on a diff in pull request #404: GUACAMOLE-1632: Have spaces written in the appended clipboard.

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: dev-unsubscribe@guacamole.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org