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

Sync cursor when first opening on viewer #17

Merged
merged 1 commit into from
Aug 1, 2024

Conversation

jannis-baum
Copy link
Owner

@jannis-baum jannis-baum commented Jul 29, 2024

Close #6

TODO before merging this:

@tuurep
Copy link
Collaborator

tuurep commented Jul 29, 2024

Perfect & fantastic

Gives me an oftopic thought though:

The way the cursor line is at the very bottom of the page feels pretty disorienting to me when opening

But what I'm getting to with this is that I wish the cursor sync could have a similar option to Vim's scrolloff, if you know what I mean

But of course it's more complicated because lines aren't a fixed size like in terminal

@jannis-baum
Copy link
Owner Author

jannis-baum commented Jul 29, 2024

But what I'm getting to with this is that I wish the cursor sync could have a similar option to Vim's scrolloff, if you know what I mean

Yes definitely. I have also had this thought but haven't followed it to think about how to implement that, haha. We use JavaScript's scrollIntoView for the scrolling, we could look into that and see how much effort it would be to implement or if that's already a feature there anyways

EDIT maybe also this. Can't look into it in detail right now.

@tuurep
Copy link
Collaborator

tuurep commented Jul 29, 2024

Yeah, that calls for a new issue

@jannis-baum
Copy link
Owner Author

Yeah, that calls for a new issue

Agree! Feel free to open one :)

@tuurep
Copy link
Collaborator

tuurep commented Jul 29, 2024

Ok, I think we explained the feat quite well here so I just quoted us with the links and all.

@tuurep
Copy link
Collaborator

tuurep commented Jul 30, 2024

This requires a small change with viv README.md:100 style scrolling added in jannis-baum/Vivify#117 (and -s removed)

@jannis-baum
Copy link
Owner Author

This requires a small change with viv README.md:100 style scrolling added in jannis-baum/Vivify#117 (and -s removed)

I'll adjust this after we've merged the PR on main Vivify :)

@jannis-baum jannis-baum force-pushed the issue/6-sync-cursor-when-first-opening-on-viewer branch from da7b6af to bc41658 Compare August 1, 2024 16:37
@jannis-baum
Copy link
Owner Author

Hello @tuurep this should work now with the version of Vivify that's currently on main. Could you confirm?

@tuurep
Copy link
Collaborator

tuurep commented Aug 1, 2024

Yes it works

We've fixed all of my little usability gripes! Huge thanks

Caution

offtopic 👇

Well I still wish I could open an empty buffer as an empty markdown preview and start typing 😄 Btw I suspect this is because file shows the filetype of such file as empty instead of markdown (doesn't care about extension), nvim would show it as markdown

What do you think, is this fixable as well?

@jannis-baum jannis-baum merged commit 822b527 into main Aug 1, 2024
@jannis-baum jannis-baum deleted the issue/6-sync-cursor-when-first-opening-on-viewer branch August 1, 2024 17:53
@jannis-baum
Copy link
Owner Author

What do you think, is this fixable as well?

If I'm not completely mistesting this then it was a one-liner ^^ Check out jannis-baum/Vivify#150

@jannis-baum
Copy link
Owner Author

I just remembered that this PR will break things if someone is on the main version of the plugin and the latest release of Vivify so I released Vivify v0.3.0. The release CI was of course broken again, eternal curse haha, but I think now I finally fixed it for good. Hope we never touch it again😂

@tuurep
Copy link
Collaborator

tuurep commented Aug 1, 2024

Ok, I'll update AUR right away

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.

Sync cursor when first opening on viewer
2 participants