microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.05k stars 29.21k forks source link

up arrow mishandles word wrap #144041

Closed af4jm closed 2 years ago

af4jm commented 2 years ago

Issue Type: Bug

since the lsat version, when using up arrow to go through a document... if you get to a place where word-wrapforces the cursor to jump to the right (because the cursor is at the left margin & word-wrap is indented)... when the cursor should go to the beginning of the wrapped line, it instead jumps tot he end of the previous line

VS Code version: Code 1.64.2 (f80445acd5a3dadef24aa209168452a3d97cc326, 2022-02-09T22:02:28.252Z) OS version: Windows_NT x64 10.0.22000 Restricted Mode: No

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz (8 x 1800)| |GPU Status|2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|31.89GB (17.59GB free)| |Process Argv|--file-uri file:///c%3A/src/AF4JM.code-workspace --crash-reporter-id 06338080-eec2-498d-98e0-cf3111dc1cde| |Screen Reader|no| |VM|0%|
Extensions (105) Extension|Author (truncated)|Version ---|---|--- html-snippets|abu|0.2.1 vscode-icalendar|af4|1.0.1 vscode-m3u|af4|1.0.0 vscode-caniuse|aga|0.5.0 case-change|Aka|1.0.2 Bookmarks|ale|13.2.4 rtf|ale|2.4.0 vscode-sqlite|ale|0.14.0 swagger-viewer|Arj|3.1.2 spellright|ban|3.0.60 armview|ben|0.4.6 markdown-checkbox|bie|0.3.2 markdown-emoji|bie|0.2.1 markdown-footnotes|bie|0.0.7 markdown-mermaid|bie|1.13.2 markdown-yaml-preamble|bie|0.1.0 vscode-tldr|bmu|1.0.0 mermaid-markdown-syntax-highlighting|bpr|1.2.2 npm-intellisense|chr|1.4.1 gitignore|cod|0.7.0 disableligatures|Coe|0.0.10 vscode-markdownlint|Dav|0.46.0 jshint|dba|0.11.0 vscode-eslint|dba|2.2.2 dendron-snippet-maker|den|0.1.6 rushcore|Dev|1.0.2 rushnav|Dev|1.0.2 githistory|don|0.6.19 xml|Dot|2.5.1 escaping-characters|drp|1.0.0 vscode-babel-coloring|dza|0.0.4 gitlens|eam|11.7.0 EditorConfig|Edi|0.16.4 vscode-npm-script|eg2|0.3.24 vscode-macros|EXC|1.3.0 git-project-manager|fel|1.8.2 scriptcsRunner|fil|0.1.0 vscode-firefox-debug|fir|2.9.6 vscode-npm|fkn|3.3.0 shell-format|fox|7.2.2 macros|ged|1.2.1 matlab|Gim|2.3.1 vscode-pull-request-github|Git|0.36.2 gc-excelviewer|Gra|4.0.50 beautify|Hoo|1.5.0 vscode-favorites|how|1.10.2 rest-client|hum|0.24.6 path-autocomplete|ion|1.18.0 mediawiki|jak|2.1.0 markdown-katex|jef|0.1.4 nuget-reverse-package-search|jes|0.1.68 vscode-nuget-package-manager|jmr|1.1.6 vscode-peacock|joh|4.0.0 gpg|jva|0.1.2 docomment|k--|0.1.30 vscode-liquid-snippets|kil|2.0.3 gnuplot|mam|1.0.5 markdown-shortcuts|mdi|0.12.0 openapi-lint|mer|1.2.0 HTMLHint|mka|0.10.0 azure-pipelines|ms-|1.195.0 vscode-azureappservice|ms-|0.23.1 vscode-azurefunctions|ms-|1.6.0 vscode-azureresourcegroups|ms-|0.4.0 vscode-azurestorage|ms-|0.13.0 vscode-azurevirtualmachines|ms-|0.5.0 vscode-bicep|ms-|0.4.1272 vscode-cosmosdb|ms-|0.18.1 csharp|ms-|1.24.0 vscode-dotnet-runtime|ms-|1.5.0 python|ms-|2022.0.1814523869 vscode-pylance|ms-|2022.2.4 jupyter|ms-|2022.1.1301854968 jupyter-keymap|ms-|1.0.0 jupyter-renderers|ms-|1.0.6 vscode-ai-remote|ms-|0.7.0 remote-containers|ms-|0.217.4 remote-ssh|ms-|0.74.0 remote-ssh-edit|ms-|0.74.0 vscode-remote-extensionpack|ms-|0.21.0 azure-account|ms-|0.10.0 azurecli|ms-|0.5.0 live-server|ms-|0.2.12 mono-debug|ms-|0.16.2 powershell|ms-|2021.12.0 vscode-node-azure-pack|ms-|0.2.1 vscode-typescript-tslint-plugin|ms-|1.3.3 azurerm-vscode-tools|msa|0.15.6 debugger-for-edge|msj|1.0.15 language-liquid|nei|0.1.1 bib|phr|0.3.0 vscode-commons|red|0.0.6 vscode-yaml|red|1.4.0 kuskus-kusto-language-server|ros|1.0.22 kuskus-kusto-syntax-highlighting|ros|1.1.20 vscode-hexdump|sle|1.8.1 vscode-zipexplorer|sle|0.3.1 addDocComments|ste|0.0.8 msbuild-project-tools|tin|0.4.3 shell-launcher|Tyr|0.4.1 vscodeintellicode|Vis|1.2.17 nanoid-generator|vk-|0.1.2 vscode-icons|vsc|11.10.0 JavaScriptSnippets|xab|1.8.0 t4-support|zbe|0.5.0
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492:30256859 pythonvspyl392cf:30425750 pythontb:30283811 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 vscorecescf:30442554 pythondataviewer:30285071 vscod805cf:30301675 pythonvspyt200:30340761 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593cf:30376535 vsc1dst:30438360 pythonvs932:30410667 wslgetstarted:30433507 vsclayoutctrc:30437038 vsrem710:30416614 vscop841:30438915 dsvsc009:30440023 pythonvsnew555:30442236 vsbas813:30436447 vscscmwlcmc:30438804 helix:30440343 ```
af4jm commented 2 years ago

by "last version" I meant 1.64... same version that made a mess of snippet matching (#142290)

alexdima commented 2 years ago

@af4jm Could you please create a screen recording, or an annotated screenshot with a specific example, I'm not sure I understand where exactly the cursor should be at the beginning in order to reproduce.

af4jm commented 2 years ago

hopefully this helps... with the cursor as captured, before the "4", prior to 1.64 the next 2 up arrows to follow the green marks I added... but since 1.64 they follow the red ones (technically, the lower green & lower red are the same place if I start typing... but if I'm renumbering my list or changing between bullets & numbers, it throws things off)

image

relevant excerpt from settings:

{
    "editor.wordWrap": "on",
    "editor.wrappingIndent": "indent"
}
af4jm commented 2 years ago

I tried the same thing, with the same file, in Obsidian... their editor (I don't know what it's based on since they're not open source) also jumps to the end of the line with "3." on the first up arrow (lower red mark), but then to the beginning of that same line on the second one (upper green mark). That behavior would also work for me... either way, going from "4." to "3." should be up arrow twice because it's the second line above

alexdima commented 2 years ago

Thanks for the extra information. I could reproduce and after doing bisect found that 98450a89e7185a1eaedf75230199edf5cae5ad24 is the first bad commit.

af4jm commented 2 years ago

has this released yet? the behavior hasn't changed. Actually, it seems to have gotten worse...

the initial issue is that if my cursor is at the left edge and I go up, up, up when I get to a word-wrap it jumps to the far right. Recently I've noticed the opposite also happening, if I'm at the right end and down-arrow at a word-wrap point, it jumps to the left end (as if I hit right arrow instead of down arrow).

the bug was that the cursor jumps between left edge and right edge, and in 1.66.2 it's as bad as ever

I probably should point out, in case it's relevant, that I run with the following settings (the exact font shouldn't matter, the point is that it's NOT monospace... this was probably evident from my screenshot, but I should've called it out anyway)

"[markdown]": {
    "editor.fontFamily": "'Noto Sans', 'Droid Sans', Ariel, sans-serif",
    "editor.wrappingStrategy": "advanced"
},
hediet commented 2 years ago

Can you try it in the latest vscode insiders?

The bugfix is planned to be released with the next release.