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

fix goto_last_window #373

Merged
merged 6 commits into from
Jan 9, 2025
Merged

fix goto_last_window #373

merged 6 commits into from
Jan 9, 2025

Conversation

funemy
Copy link
Contributor

@funemy funemy commented Jan 8, 2025

Jumping back to the associated lean file from the current infoview does not work in the current version.

The bug is that the self in goto_last_window refers to the metatable Info instead of the new_info table (where last_window is set).

I'm not familiar with this project nor Lua, so hopefully this fix makes sense.
Thanks for the awesome nvim plugin, btw!

@Julian
Copy link
Owner

Julian commented Jan 8, 2025

Thanks a lot for the PR and the kind words!

That's... "funny", you'd have thought I'd have noticed that but I guess I personally use the jumplist more often than this mapping.

It'd be good to add a test for this I think before merging. You might be able to cargo cult the tests you see e.g. in spec/infoview/open_close_spec.lua in order to create some simple new spec file without knowing much Lua (or much about the project yet). But I'm also quite happy to help or to do so myself if you run into trouble.

Does that sound like something you could have a look at? Regardless thanks for sending the PR!

@funemy
Copy link
Contributor Author

funemy commented Jan 8, 2025

@Julian I added some tests for jumps between Lean file and infoview, lmk if they make sense.

lua/lean/infoview.lua Outdated Show resolved Hide resolved
spec/infoview/jump_spec.lua Outdated Show resolved Hide resolved
@Julian Julian merged commit dbb4196 into Julian:main Jan 9, 2025
6 checks passed
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