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

Cursor sync offset/more centered (like Vim's scrolloff) #146

Open
tuurep opened this issue Jul 29, 2024 · 4 comments
Open

Cursor sync offset/more centered (like Vim's scrolloff) #146

tuurep opened this issue Jul 29, 2024 · 4 comments
Assignees
Labels
topic:infrastructure e.g. API, config type:feature New feature or request

Comments

@tuurep
Copy link
Collaborator

tuurep commented Jul 29, 2024

From offtopic discussion

Me:

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:

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.

@jannis-baum
Copy link
Owner

This is probably a topic for main Vivify🙈

@tuurep
Copy link
Collaborator Author

tuurep commented Jul 29, 2024

Oh.. okay

E: transfer was surprisingly easy

@tuurep tuurep transferred this issue from jannis-baum/vivify.vim Jul 29, 2024
@jannis-baum
Copy link
Owner

Fancy! I have never used this transfer feature before but seems like its perfect for us!

@tuurep tuurep added type:feature New feature or request topic:infrastructure e.g. API, config labels Jul 29, 2024
@jannis-baum
Copy link
Owner

@tuurep I think for this we'll need a way to pass config options to the client. Maybe you could adjust

window.VIV_PORT = "${config.port}";
window.VIV_PATH = "${urlToPath(req.path)}";

to just add one property to window, e.g.

`window.VIV_INFO = {
    "port": "${config.port}",
    "path": "${urlToPath(req.path)}",
    "config": {
        // ...
    }
}`

so that we don't pollute it and end up with a million things on window.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic:infrastructure e.g. API, config type:feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants