-
-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preserve scroll position in markdown viewer #830
Comments
You are right. This is happening with nightly build too. |
Is it consider as a bug, or a feature? Besides, could you make the edit pane and preview pane scroll synchronously? |
I guess that is a bug.
That would require source-to-source mapping to keep the track of corresponding snapshot. Otherwise, changes in rendered font-size may lead to the scenarios where it would lose the scope. This might give you some idea about the nature of this problem: #783. |
So, is there a |
I have not been able to find any Markdown compiler which gives any kind of information about the source file. (this is why I needed to write my own parser for the Markdown syntax highlighting) |
Not to my knowledge; no. We are using MarkdownSharp http://code.google.com/p/markdownsharp/ to compile markdown. Once the compiler does the job, we don't have that kind of context to guess the definite mapping. Case in hand is SCSS compiler which generates incorrect map #828. No matter what we do, we just can't predict what went inside the compiler. |
Is that project still alive? The latest commit is one year ago. |
Yes. It seems like dead.. Long shot: If CodePlex team has C# based markdown editor, maybe they can update it with V3 source maps. @SLaks, (for preserving scroll position) is there a way to get the "first visible line number" of the view, if we don't have a tracking span? In After that in For percentage scroll, we can do something like: _totalLines = Document.TextBuffer.CurrentSnapshot.LineCount;
_firstLineInCurrentVisibility = ?;
_scrollPercentage = _currentLine * 100 / _totalLines;
_browser.NavigateToString(html); // this is asynchronous.
// .....
// after asynchronous operation completes and scroll position is disturbed, in callback:
// .....
_totalLines = Document.TextBuffer.CurrentSnapshot.LineCount;
int lineToNavigate = _scrollPercentage * _totalLines / 100;
for(int i = 0; i < lineToNavigate; ++I)
{
_textView.TextView.ViewScroller.ScrollViewportVerticallyByLine(ScrollDirection.Down);
} |
We need to scroll the browser, not the editor. |
Cool. While looking into getting scroll position, I found this https://www.mail-archive.com/[email protected]/msg09449.html issue which pointed to another markdown editor for VS, which uses Chromium: https://github.com/Code52/DownmarkerWPF 😄 |
Fixed by am11@515949d. All those commits happened during |
Markdown: Preserve scrolling on compile (#830)
Hi, I am getting into trouble. After save a markdown file, the content is rendered automatically, and the scroll bar of the preview pane always go back to the top.
I get a FIXED from this link, but I still got the trouble in the latest stable version (v1.9).
Besides, I cannot try nightly build (v1.9.8) because I do not have VS 2013 Update 2.
The text was updated successfully, but these errors were encountered: