Skip to content
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

make live-preview follow min or max point #102

Conversation

cosmicexplorer
Copy link
Contributor

This makes the output buffer window's point for markdown-live-preview-mode stay at point-min or point-max, if the window displaying markdown-live-preview-buffer was already at point-min or point-max. This means the output buffer will not have to be manually re-scrolled down if the user is adding lots of text to to the bottom of a file and using live-preview.

@cosmicexplorer cosmicexplorer force-pushed the fix/follow-point-max-live-preview branch from 81e6be8 to 532ba23 Compare February 22, 2016 14:34
@cosmicexplorer
Copy link
Contributor Author

Ok, for some reason this works just fine interactively, but behaves differently in batch mode (the eternal struggle), causing the test to fail. I'll find a way to trip this appropriately.

@cosmicexplorer cosmicexplorer force-pushed the fix/follow-point-max-live-preview branch from 17015f8 to f5dc0f2 Compare February 23, 2016 21:16
@cosmicexplorer
Copy link
Contributor Author

This might also fix some of the errors #69 is having too because of the fix to markdown-temp-eww. I also changed it to make sure the number of visual lines between window-point and window-start is used, instead of real lines.

Now that make evm exists, I'll fix the errors each version is having on these tests.

@cosmicexplorer cosmicexplorer force-pushed the fix/follow-point-max-live-preview branch 3 times, most recently from effa6c0 to 91f8cf9 Compare February 24, 2016 11:21
@cosmicexplorer
Copy link
Contributor Author

Ok, this should work. Most of the issue was that I forgot that markdown-temp-eww doesn't actually use eww, and I forgot that the CI server sometimes doesn't have libxml2 compiled in. This should satisfy the CI server.

@jrblevin
Copy link
Owner

For some reason (featurep 'libxml2) returns nil on my Emacs (25.1.50.1 on OS X), so the test-markdown-ext/live-preview-exports fails.

@jrblevin
Copy link
Owner

The above mentioned 25.1 build was from emacsforosx.com. I tried a build of 24.5 from MacPorts and it also returns nil. Both have eww.

- also make ci server happy by requiring libxml-parse-html-region
@cosmicexplorer cosmicexplorer force-pushed the fix/follow-point-max-live-preview branch from 91f8cf9 to a25d0d1 Compare February 24, 2016 22:36
@cosmicexplorer
Copy link
Contributor Author

That's because libxml2 isn't a "feature" in emacs lisp, I was going too fast and thought I remembered how libxml2 was checked. I've changed that to (fboundp 'libxml-parse-html-region), which is how eww checks whether or not it's able to parse html. That's weird that it was failing, though; it should just skip it. Can you describe what the error was? Either way, this should fix it.

@jrblevin
Copy link
Owner

Thanks. That's right--I think we saw a similar issue before, but I forgot.

I'll check this version again soon. Here's the error I got before:

Test test-markdown-ext/live-preview-exports condition:
    (ert-test-failed
     ((should-error
       (markdown-live-preview-mode))
      :form
      (markdown-live-preview-mode)
      :value t :fail-reason "did not signal an error"))
   FAILED   22/248  test-markdown-ext/live-preview-exports

@cosmicexplorer
Copy link
Contributor Author

Oh ok, that makes sense. I was worried it was from somewhere else.

@jrblevin
Copy link
Owner

Thanks, I rebased and applied this as dda54f7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants