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

open finder reference in the calling window #1283

Merged
merged 1 commit into from
Sep 21, 2023
Merged

Conversation

defr0std
Copy link
Contributor

@defr0std defr0std commented Sep 7, 2023

This is a small convenience improvement. Currently, when the finder uses a normal layout with sp_global, the reference is always open ('toggle_or_open') in the leftmost window. This is quite inconvenient when working with multiple vertical splits. Imagine that you search for reference in the right split, and then the reference is open in the left split, which has a completely different context.

When the finder is open, we memorize the current window id. When the reference is opened, we use that window id instead of 0 (which by this time is already the leftmost).

For float layout, or normal with sp_global=false, there is no change in behavior.

This is a small convenience improvement. Currently, when the finder uses
a normal layout with sp_global, the reference is always open
('toggle_or_open') in the leftmost window. This is quite inconvenient
when working with multiple vertical splits. Imagine that you search for
reference in the right split, and then the reference is open in the left
split, which has a completely different context.

When the finder is open, we memorize the current window id. When the
reference is opened, we use that window id instead of 0 (which by this
time is already the leftmost).

For float layout, or normal with sp_global=false, there is no change in
behavior.
@glepnir
Copy link
Member

glepnir commented Sep 16, 2023

sorry for late . should check layout ? looks like only useful on float right ?

@defr0std
Copy link
Contributor Author

No, this is useful only in normal layout with sp_global=true. In this case, the finder reference will be open in the window from which the finder was started. In all other use cases, there is no change in behavior.

@glepnir glepnir merged commit b1c3e87 into nvimdev:main Sep 21, 2023
4 checks passed
Dosx001 pushed a commit to Dosx001/lspsaga.nvim that referenced this pull request Nov 18, 2023
This is a small convenience improvement. Currently, when the finder uses
a normal layout with sp_global, the reference is always open
('toggle_or_open') in the leftmost window. This is quite inconvenient
when working with multiple vertical splits. Imagine that you search for
reference in the right split, and then the reference is open in the left
split, which has a completely different context.

When the finder is open, we memorize the current window id. When the
reference is opened, we use that window id instead of 0 (which by this
time is already the leftmost).

For float layout, or normal with sp_global=false, there is no change in
behavior.
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