{"action":"created","issue":{"url":"https://api.github.com/repos/rstudio/rstudio/issues/3036","repository_url":"https://api.github.com/repos/rstudio/rstudio","labels_url":"https://api.github.com/repos/rstudio/rstudio/issues/3036/labels{/name}","comments_url":"https://api.github.com/repos/rstudio/rstudio/issues/3036/comments","events_url":"https://api.github.com/repos/rstudio/rstudio/issues/3036/events","html_url":"https://github.com/rstudio/rstudio/issues/3036","id":334179927,"node_id":"MDU6SXNzdWUzMzQxNzk5Mjc=","number":3036,"title":"Text with non-uniform spacing loses spaces when pasting in RStudio server's editor","user":{"login":"david-cortes","id":11860098,"node_id":"MDQ6VXNlcjExODYwMDk4","avatar_url":"https://avatars0.githubusercontent.com/u/11860098?v=4","gravatar_id":"","url":"https://api.github.com/users/david-cortes","html_url":"https://github.com/david-cortes","followers_url":"https://api.github.com/users/david-cortes/followers","following_url":"https://api.github.com/users/david-cortes/following{/other_user}","gists_url":"https://api.github.com/users/david-cortes/gists{/gist_id}","starred_url":"https://api.github.com/users/david-cortes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/david-cortes/subscriptions","organizations_url":"https://api.github.com/users/david-cortes/orgs","repos_url":"https://api.github.com/users/david-cortes/repos","events_url":"https://api.github.com/users/david-cortes/events{/privacy}","received_events_url":"https://api.github.com/users/david-cortes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-20T17:30:26Z","updated_at":"2018-06-20T19:49:58Z","closed_at":null,"author_association":"NONE","body":"In RStudio server accessed through Vivaldi browser (chromium-based), when attempting to copy-paste some long multi-line text with non-uniform spacing (e.g. some lines start with more tab-spaces or spaces than others) into the editor, they all lose their spacing at the start of each line. This behavior does not occur when the text to copy-paste is small though, and I'm not sure what characteristics or length does it need to have in order for it to be automatically reformated\r\n\r\n**Steps to reproduce:**\r\n* Write some multi-line text in RStudio local or some text edit.\r\n* Copy it to the clipboard.\r\n* Paste it into the RStudio editor in RStudio server accessed from Vivaldi browser.\r\n\r\n**Expected behavior:**\r\n* Text should copy-paste as it is.\r\n\r\n**Actual behavior:**\r\n* All spacing at the beginning of lines is set to one tab-space.*\r\n\r\n**Reproducible:** with some inputs only.\r\n\r\n**Setup:** RStudio server version 1.1.383, R version 3.3.3, running on Debian oldstable (Jessie), accessed from Vivaldi running chromium 67, in a linux system (Debian buster/sid) running KDE 5.12.5.\r\n\r\nThe following text produces this problem:\r\n``` R\r\ntext <- \"\r\n  This line here starts with a tab\r\n  This line also starts with a tab\r\n  This line also starts with a tab\r\n  This line also starts with a tab\r\n  This line also starts with a tab\r\n  This line also starts with a tab (\r\n  \tThis line starts with two tabs\r\n           This line has irregular spacing\r\n  \tThis line starts with two tabs\r\n  \tThis line starts with two tabs\r\n  \tThis line starts with two tabs\r\n  \tJThis line starts with two tabs\r\n  \tThis line starts with two tabs\r\n         This line has irregular spacing\r\n  \tThis line starts with two tabs\r\n          This line has irregular spacing\r\n  \tThis line starts with two tabs\r\n  ) This line also starts with a tab\r\n       This line has irregular spacing\r\n  This line also starts with a tab NULL\r\n        This line has irregular spacing\r\n  \"\r\n```"},"comment":{"url":"https://api.github.com/repos/rstudio/rstudio/issues/comments/398874467","html_url":"https://github.com/rstudio/rstudio/issues/3036#issuecomment-398874467","issue_url":"https://api.github.com/repos/rstudio/rstudio/issues/3036","id":398874467,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODg3NDQ2Nw==","user":{"login":"ronblum","id":31009952,"node_id":"MDQ6VXNlcjMxMDA5OTUy","avatar_url":"https://avatars3.githubusercontent.com/u/31009952?v=4","gravatar_id":"","url":"https://api.github.com/users/ronblum","html_url":"https://github.com/ronblum","followers_url":"https://api.github.com/users/ronblum/followers","following_url":"https://api.github.com/users/ronblum/following{/other_user}","gists_url":"https://api.github.com/users/ronblum/gists{/gist_id}","starred_url":"https://api.github.com/users/ronblum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronblum/subscriptions","organizations_url":"https://api.github.com/users/ronblum/orgs","repos_url":"https://api.github.com/users/ronblum/repos","events_url":"https://api.github.com/users/ronblum/events{/privacy}","received_events_url":"https://api.github.com/users/ronblum/received_events","type":"User","site_admin":false},"created_at":"2018-06-20T19:49:58Z","updated_at":"2018-06-20T19:49:58Z","author_association":"NONE","body":"@david-cortes I was able to reproduce this on a different configuration, although in my case, the spacing disappeared entirely—no tabs or spaces. This with RStudio Server 1.2.747 on MacOS 12.10.6 (Sierra), using Google Chrome and Safari, both when copying directly or first copying to Word or Notepad (where it pasted fine) and then into RStudio. Note that removing the (needed) quotes makes the problem go away."}}
{"actor":{"display_login":"ronblum"}}