{"thread":{"id":"58071","subject":"[PATCH] vscode: improve tab size and wrapping","startedAt":"2022-06-27T18:34:50Z","lastAt":"2022-06-27T21:58:14Z","messageCount":2,"participants":["Derrick Stolee via GitGitGadget","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"457929","messageId":"pull.1271.git.1656354587496.gitgitgadget@gmail.com","threadId":"58071","inReplyTo":null,"subject":"[PATCH] vscode: improve tab size and wrapping","fromName":"Derrick Stolee via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2022-06-27T18:29:47Z","receivedAt":"2022-06-27T18:34:50Z","isPatch":true,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"From: Derrick Stolee <derrickstolee@github.com>\n\nThe contrib/vscode/init.sh script initializes the .vscode directory with\nsome helpful metadata so VS Code handles Git code better.\n\nOne big issue that VS Code has is detecting the tab width based on file\ntype. \".txt\" files were not covered by this script before, so add them\nwith the appropriate tab widths. This prevents inserting spaces instead\nof tabs and keeps the tab width to eight instead of four or two.\n\nWhile we are here, remove the \"editor.wordWrap\" settings. The editor's\nword wrap is only cosmetic: it does not actually insert newlines when\nyour typing goes over the column limit. This can make it appear like you\nhave properly wrapped code, but it is incorrect. Further, existing code\nthat is over the column limit is wrapped even if your editor window is\nwider than the limit. This can make reading such code more difficult.\nWithout these lines, VS Code renders the lines accurately, without\n\"ghost\" newlines.\n\nSigned-off-by: Derrick Stolee <derrickstolee@github.com>\n---\n    vscode: improve tab size and wrapping\n    \n    I've been using these settings myself for a few weeks now. Fixed some\n    problems I saw in recent submissions.\n    \n    Abhradeep was having similar issues, which drove me to actually submit\n    the change.\n    \n    Thanks, -Stolee\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-1271%2Fderrickstolee%2Fvscode-improvements-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1271/derrickstolee/vscode-improvements-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/1271\n\n contrib/vscode/init.sh | 8 ++++++--\n 1 file changed, 6 insertions(+), 2 deletions(-)\n\ndiff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh\nindex f139fd86444..521d3037225 100755\n--- a/contrib/vscode/init.sh\n+++ b/contrib/vscode/init.sh\n@@ -25,8 +25,12 @@ cat >.vscode/settings.json.new <<\\EOF ||\n         \"editor.detectIndentation\": false,\n         \"editor.insertSpaces\": false,\n         \"editor.tabSize\": 8,\n-        \"editor.wordWrap\": \"wordWrapColumn\",\n-        \"editor.wordWrapColumn\": 80,\n+        \"files.trimTrailingWhitespace\": true\n+    },\n+    \"[txt]\": {\n+        \"editor.detectIndentation\": false,\n+        \"editor.insertSpaces\": false,\n+        \"editor.tabSize\": 8,\n         \"files.trimTrailingWhitespace\": true\n     },\n     \"files.associations\": {\n\nbase-commit: e4a4b31577c7419497ac30cebe30d755b97752c5\n-- \ngitgitgadget\n"},{"id":"457970","messageId":"xmqq8rphojos.fsf@gitster.g","threadId":"58071","inReplyTo":"pull.1271.git.1656354587496.gitgitgadget@gmail.com","subject":"Re: [PATCH] vscode: improve tab size and wrapping","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-06-27T21:55:31Z","receivedAt":"2022-06-27T21:58:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Derrick Stolee via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> From: Derrick Stolee <derrickstolee@github.com>\n>\n> The contrib/vscode/init.sh script initializes the .vscode directory with\n> some helpful metadata so VS Code handles Git code better.\n>\n> One big issue that VS Code has is detecting the tab width based on file\n> type. \".txt\" files were not covered by this script before, so add them\n> with the appropriate tab widths. This prevents inserting spaces instead\n> of tabs and keeps the tab width to eight instead of four or two.\n>\n> While we are here, remove the \"editor.wordWrap\" settings. The editor's\n> word wrap is only cosmetic: it does not actually insert newlines when\n> your typing goes over the column limit. This can make it appear like you\n> have properly wrapped code, but it is incorrect. Further, existing code\n> that is over the column limit is wrapped even if your editor window is\n> wider than the limit. This can make reading such code more difficult.\n> Without these lines, VS Code renders the lines accurately, without\n> \"ghost\" newlines.\n>\n> Signed-off-by: Derrick Stolee <derrickstolee@github.com>\n> ---\n\nNicely described and I found it very easy to understand the\nreasoning behind every change, even though I am not a regular user\nof the VS Code environment.\n\n>     Abhradeep was having similar issues, which drove me to actually submit\n>     the change.\n>     \n>     Thanks, -Stolee\n\nThanks, both.\n\n>\n> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1271%2Fderrickstolee%2Fvscode-improvements-v1\n> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1271/derrickstolee/vscode-improvements-v1\n> Pull-Request: https://github.com/gitgitgadget/git/pull/1271\n>\n>  contrib/vscode/init.sh | 8 ++++++--\n>  1 file changed, 6 insertions(+), 2 deletions(-)\n>\n> diff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh\n> index f139fd86444..521d3037225 100755\n> --- a/contrib/vscode/init.sh\n> +++ b/contrib/vscode/init.sh\n> @@ -25,8 +25,12 @@ cat >.vscode/settings.json.new <<\\EOF ||\n>          \"editor.detectIndentation\": false,\n>          \"editor.insertSpaces\": false,\n>          \"editor.tabSize\": 8,\n> -        \"editor.wordWrap\": \"wordWrapColumn\",\n> -        \"editor.wordWrapColumn\": 80,\n> +        \"files.trimTrailingWhitespace\": true\n> +    },\n> +    \"[txt]\": {\n> +        \"editor.detectIndentation\": false,\n> +        \"editor.insertSpaces\": false,\n> +        \"editor.tabSize\": 8,\n>          \"files.trimTrailingWhitespace\": true\n>      },\n>      \"files.associations\": {\n>\n> base-commit: e4a4b31577c7419497ac30cebe30d755b97752c5\n"}]}