You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Igor Dvorkin (@idvorkin) This reproes for me as well. It seems to happen only when the file preview is from a file opened from the file system directly and not from a folder currently loaded in the file explorer. For instance, from the picture below:
README.md opened directly as a file, its preview will not auto scroll. generators.md opened from the docs folder, which is loaded in the file explorer, will have its preview auto scroll fine.
Do you see the same behavior? Probably a path resolution issue.
Igor Dvorkin (@idvorkin) awesome. What do you think about updating the issue description (step 3)
From: Scroll in markdown window (preview does not scroll) :(
To: Scroll in preview window (source does not scroll)
Since it's expected to sync only preview -> source, not the other way around?
I looked briefly at this today and it seems the problem is on vscode\extensions\markdown\src\extension.ts, in the path comparison made in snippet below
A simple toUpperCase() on both sides makes this work which proves this is the issue. Obviously this isn't a proper fix for OSs that have a case sensitive file system. It also seems that having the lowercase windows drive letter is by design in many places:
So I guess a proper fix here would be finding out why editor.document.uri.path doesn't return a normalized path?
I've updated the description, although both directions should work! Thanks for digging in. By the way, thanks your digging I'm unblocked, and this is a great feature!
Thanks all for the investigation. I've created #20064 which I believe should fix this. As noted, in some Windows scenarios, the drive letter differs between the preview document and the editor document. Using fsPath should fix this. I'm planning to take the fix into the 1.10 insiders builds and also our next 1.9 recovery build
Thanks for the quick fix Matt Bierner (@mjbvz)! I've looked into this a bit more and the root cause is on the way the original source document's URI is created on \vscode\src\vs\base\common\uri.ts
An else if on "public static file(path: string): URI" would help you avoid all those || on your case and probably prevent other future bugs too.
elseif(URI._upperCaseDrive.test(path)){// windows drive letter: file:///c:/far/booret._path=path[0].toLowerCase()+path.substr(1);}
Thanks Fabio Rocha (@fabiorocha). That be worth looking into in the future, but I don't want to touch functionality that is so central for this fix. After reviewing the fsPath logic, I think using it should be safe and address the problem. Path casing issues have caused us lots of trouble in the past, so this is an area that we certainly need to revisit but one that can also be pretty finicky
b4aac1c cherry-picked this workaround into our 1.9 branch to be picked up in the next recovery build
Activity
fabiorocha commentedon Feb 4, 2017
Igor Dvorkin (@idvorkin) This reproes for me as well. It seems to happen only when the file preview is from a file opened from the file system directly and not from a folder currently loaded in the file explorer. For instance, from the picture below:
README.md opened directly as a file, its preview will not auto scroll.
generators.md opened from the docs folder, which is loaded in the file explorer, will have its preview auto scroll fine.
Do you see the same behavior? Probably a path resolution issue.
idvorkin commentedon Feb 4, 2017
Fabio Rocha (@fabiorocha) Good debugging :) I've got the same behavior.
fabiorocha commentedon Feb 5, 2017
Igor Dvorkin (@idvorkin) awesome. What do you think about updating the issue description (step 3)
From:
Scroll in markdown window (preview does not scroll) :(
To:
Scroll in preview window (source does not scroll)
Since it's expected to sync only preview -> source, not the other way around?
I looked briefly at this today and it seems the problem is on vscode\extensions\markdown\src\extension.ts, in the path comparison made in snippet below
Note the drive letter:
A simple toUpperCase() on both sides makes this work which proves this is the issue. Obviously this isn't a proper fix for OSs that have a case sensitive file system. It also seems that having the lowercase windows drive letter is by design in many places:
So I guess a proper fix here would be finding out why editor.document.uri.path doesn't return a normalized path?
idvorkin commentedon Feb 5, 2017
I've updated the description, although both directions should work! Thanks for digging in. By the way, thanks your digging I'm unblocked, and this is a great feature!
mjbvz commentedon Feb 6, 2017
Thanks all for the investigation. I've created #20064 which I believe should fix this. As noted, in some Windows scenarios, the drive letter differs between the preview document and the editor document. Using
fsPathshould fix this. I'm planning to take the fix into the 1.10 insiders builds and also our next 1.9 recovery buildfabiorocha commentedon Feb 6, 2017
Thanks for the quick fix Matt Bierner (@mjbvz)! I've looked into this a bit more and the root cause is on the way the original source document's URI is created on \vscode\src\vs\base\common\uri.ts
An else if on "public static file(path: string): URI" would help you avoid all those || on your case and probably prevent other future bugs too.
mjbvz commentedon Feb 6, 2017
Thanks Fabio Rocha (@fabiorocha). That be worth looking into in the future, but I don't want to touch functionality that is so central for this fix. After reviewing the
fsPathlogic, I think using it should be safe and address the problem. Path casing issues have caused us lots of trouble in the past, so this is an area that we certainly need to revisit but one that can also be pretty finickyb4aac1c cherry-picked this workaround into our 1.9 branch to be picked up in the next recovery build
fabiorocha commentedon Feb 6, 2017
Matt Bierner (@mjbvz) Totally understandable. Thanks again for the quick fix and for the great feature!