Skip to content

Add support for opening in split layouts and using transient previews#12

Open
abierbaum wants to merge 5 commits intoaziz:masterfrom
abierbaum:add_layout_support
Open

Add support for opening in split layouts and using transient previews#12
abierbaum wants to merge 5 commits intoaziz:masterfrom
abierbaum:add_layout_support

Conversation

@abierbaum
Copy link

This PR isn't ready for merging, but I wanted to get some feedback and ideas from people.

This PR adds to main features:

First, it attempts to detect when the current window has a split layout and in that case it will open the files in the "other split" as opposed to in the same one as the find results. This smooths out my workflow quite a bit because it lets me keep the find results still front and center to jump to the next result if needed.

Second, it adds support for using a transient window as a preview when there are multiple splits in the layout. So for example if you have your window split in two with one view on the left and one on the right, and you do a search with your results shown in the left view, then as you step through the results with n,p keys, you will see a preview of the results in the pane on the right. The plugin will highlight the match in the preview window to make it easier to see in full context.

Assuming other people think this is useful, there are still some places that need smoothed out in the code. I have added questions about them in the PR below.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a common base class for the plugins. If there is a better way to do this please let me know.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a new command that simply calls through to find_nex and find_prev but has the hook to add the transient view file preview.

The previous code would fail if the line being searched for
was on the first line of the buffer.
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.

1 participant