Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Duplicate Line pushes viewport down on long files #21

Open
DaveyUS opened this issue Oct 29, 2021 · 7 comments
Open

Duplicate Line pushes viewport down on long files #21

DaveyUS opened this issue Oct 29, 2021 · 7 comments

Comments

@DaveyUS
Copy link

DaveyUS commented Oct 29, 2021

Great addition! I've been holding out for VS Code functionality for some time.

On long documents that extend past the bottom of the viewport, if you use your new duplicate shortcuts on a line near the top of the doc, it will jump the view to the bottom of the doc, which is of course pretty jarring. It works as it should otherwise, but you have to scroll all the way up every time you duplicate.

Forgive me if this is some problem with all of my custom CSS or something.

Thanks for doing what you do!

@SkepticMystic
Copy link
Owner

Hey Davey!
Thanks for noting this. It definitely is an issue. I've tried a few ways of fixing it already, but everytime potential solution always has some unexpected consequence.. fixing scrolling on long notes breaks it for short ones, and vice versa.
I will try learn if there is a better way to do it, because it also annoys me 😋

@SkepticMystic
Copy link
Owner

@DaveyUS I think I've found a solution. Now, it will try scrolling the copied line into the middle of the screen (if there are enough lines above it).
This isn't perfect, but it feels alot better to me. Please let me know your thought when you are able.
@FelipeRearden, please also let me know what you think :)

@FelipeRearden
Copy link

FelipeRearden commented Oct 30, 2021

@DaveyUS I think I've found a solution. Now, it will try scrolling the copied line into the middle of the screen (if there are enough lines above it).

This isn't perfect, but it feels alot better to me. Please let me know your thought when you are able.

@FelipeRearden, please also let me know what you think :)

Thank you very much @SkepticMystic for mention me :)

I'm feeling extremely comfortable with this new feature!

I tested the many scenarios that I know in a long note as @DaveyUS mentioned:

  • active line with a single "line";
  • active line with multiple "lines";
  • active line with multiples "lines" where the line "cut" by the viewport on the top;
  • active line with multiples "lines" where the line "cut" by the viewport on the bottom;
  • Copy Current Line Downwards from the bottom of the viewport;
  • Copy Current Line Upwards from the bottom of the viewport;
  • Copy Current Line Downwards from the top of the viewport;
  • Copy Current Line Upwards from the bottom of the viewport;

In my humble opinion, 100% working on those scenarios:

  • Obsidian 0.12.19 version 0.3.0

Let wait the see @DaveyUS feedback :)

Let me know if you new any different test @SkepticMystic :)

I wish you guys a fantastic day!

@SkepticMystic
Copy link
Owner

@FelipeRearden thank you so much for testing so rigorously!
I did notice a bug with the new implementation, and so I have changed how it works in 0.3.1. My tests work alot better now, so I think it is improved in the new version.

@DaveyUS
Copy link
Author

DaveyUS commented Oct 30, 2021

It's definitely better in the new update!

I'm still getting jumps, but it's much less extreme. The goal is to get it to VS Code level where it doesn't jump ever, but I'm guessing you're forced to implement this in hacky kind of way so that might not be doable?

Either way this works and saves me clicks so I'm grateful!

@SkepticMystic
Copy link
Owner

I think my current approach is actually doing what VS Code does, just with alot less leniency for when to scroll the view.
I'll see if I can get it to that level :)

@FelipeRearden
Copy link

FelipeRearden commented Oct 30, 2021

I think my current approach is actually doing what VS Code does, just with alot less leniency for when to scroll the view.

Just to let you guys know that version 0.3.3 have the same comfortable scroll that I feel in version 0.3.0 everything god with the new version @SkepticMystic 😃

I'll see if I can get it to that level :)

Good luck 🍀 !

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

No branches or pull requests

3 participants