Title: Bad auto indent of line to previous code block when pasting at the beginning of the line · Issue #6927 · microsoft/vscode-python · GitHub
Open Graph Title: Bad auto indent of line to previous code block when pasting at the beginning of the line · Issue #6927 · microsoft/vscode-python
X Title: Bad auto indent of line to previous code block when pasting at the beginning of the line · Issue #6927 · microsoft/vscode-python
Description: If a line is below a code block (if, for, try def etc) but not part of the code block and you paste something where the selection start is at the beginning of the line, the line will auto indent to be a part of the code block. This does ...
Open Graph Description: If a line is below a code block (if, for, try def etc) but not part of the code block and you paste something where the selection start is at the beginning of the line, the line will auto indent to...
X Description: If a line is below a code block (if, for, try def etc) but not part of the code block and you paste something where the selection start is at the beginning of the line, the line will auto indent to...
Opengraph URL: https://github.com/microsoft/vscode-python/issues/6927
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bad auto indent of line to previous code block when pasting at the beginning of the line","articleBody":"If a line is below a code block (`if`, `for`, `try` `def` etc) but not part of the code block and you paste something where the selection start is at the beginning of the line, the line will auto indent to be a part of the code block. This does not occur if the code block ends with `return`, `break`, `continue` etc.\r\n\r\n## Environment data\r\n\r\nVersion: 1.37.0 (user setup)\r\nCommit: 036a6b1d3ac84e5ca96a17a44e63a87971f8fcc8\r\nDate: 2019-08-08T02:33:50.993Z\r\nElectron: 4.2.7\r\nChrome: 69.0.3497.128\r\nNode.js: 10.11.0\r\nV8: 6.9.427.31-electron.0\r\nOS: Windows_NT x64 10.0.17763\r\nPython Extension: 2019.8.29288\r\nPython Language Server: 0.3.46\r\n\r\n## Expected behaviour\r\n```python\r\nif 1 == 1:\r\n print('This line belongs to the if')\r\nnewvar = 'not part of if'\r\n```\r\n## Actual behaviour\r\nFor pasting at _beginning_ of line (see 3. below)\r\n```python\r\nif 1 == 1:\r\n print('This line belongs to the if')\r\n newvarnewline = 'not part of if'\r\n```\r\nFor pasting _over_ `newline` (see 4. below)\r\n```python\r\nif 1 == 1:\r\n print('This line belongs to the if')\r\n newvar = 'not part of if'\r\n```\r\n## Steps to reproduce:\r\n1. Start with these lines:\r\n```python\r\nif 1 == 1:\r\n print('This line belongs to the if')\r\nnewline = 'not part of if'\r\n```\r\n2. Copy to the clipboard this text: `newvar`\r\n3. Paste the text at the beginning of the line: `|newline = 'not part of if'`\r\n(`|` symbolizes where the cursor is before paste)\r\n4. Alternatively: Highlight `newline` and paste over it with copied text.\r\n","author":{"url":"https://github.com/WhistleWhileYouWork","@type":"Person","name":"WhistleWhileYouWork"},"datePublished":"2019-08-11T16:11:02Z","url":"https://github.com/microsoft/vscode-python/issues/6927"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5ba95229-d09d-4d6b-79a1-40f3befcaea9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8A40:271FB5:558400:703F56:6AFE6B14 |
| html-safe-nonce | fc85d1a49530764e5a041e80ffa56d825c82a5e784c066a9429ce8a0f65a4f39 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QTQwOjI3MUZCNTo1NTg0MDA6NzAzRjU2OjZBRkU2QjE0IiwidmlzaXRvcl9pZCI6IjI2ODUxMDczODM2NjI3MDEzMzIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 68380b28e466c6c137e564424259af383e90a7a2a1a9c3eeb01acf699f1ba834 |
| hovercard-subject-tag | issue:479385359 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/vscode-python/6927/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b5c249c391e3485b75c95bcc1252555130001393ce0bf02ded9faaa118f29687/microsoft/vscode-python/issues/6927 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b5c249c391e3485b75c95bcc1252555130001393ce0bf02ded9faaa118f29687/microsoft/vscode-python/issues/6927 |
| og:image:alt | If a line is below a code block (if, for, try def etc) but not part of the code block and you paste something where the selection start is at the beginning of the line, the line will auto indent to... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | WhistleWhileYouWork |
| hostname | github.com |
| expected-hostname | github.com |
| None | b3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/vscode-python git https://github.com/microsoft/vscode-python.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 106462765 |
| octolytics-dimension-repository_nwo | microsoft/vscode-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | true |
| octolytics-dimension-repository_parent_id | 49946255 |
| octolytics-dimension-repository_parent_nwo | DonJayamanne/pythonVSCode |
| octolytics-dimension-repository_network_root_id | 49946255 |
| octolytics-dimension-repository_network_root_nwo | DonJayamanne/pythonVSCode |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4a10310af51a1bfffbedc4fd81cb582acf0cb0ff |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width