Add support for opening in split layouts and using transient previews#12
Open
abierbaum wants to merge 5 commits intoaziz:masterfrom
Open
Add support for opening in split layouts and using transient previews#12abierbaum wants to merge 5 commits intoaziz:masterfrom
abierbaum wants to merge 5 commits intoaziz:masterfrom
Conversation
- Add code to delay view processing until it is loaded - Highlight the find term in the transient view
Author
There was a problem hiding this comment.
Added a common base class for the plugins. If there is a better way to do this please let me know.
Author
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.