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

Added per provider cursor position for the Pattern editor. #1861

Merged
merged 4 commits into from
Sep 15, 2024

Conversation

paxcut
Copy link
Contributor

@paxcut paxcut commented Aug 21, 2024

Problem description

Currently, the pattern editor does not remember where the cursor is located in each provider. For example, suppose you have 2 providers in your project, and you scrolled down to line 200 in the first pattern to make some changes and remembered that the code you want to insert is in the second provider. Then you switch to the second provider, look for the code and find it in line 235. Switch back to the first one, and you are at the beginning of the file. So you again look for the line to edit paste it to realize that it needs code a few lines before the place you found it. You switch to the second provider, and you are at the top again. This gets annoying very fast.

Implementation description

This PR ensures that, when you return to the pattern in the editor for any of the opened providers, the cursor will still be at the same place it was when you switched to a different one. Each provider pattern saves its cursor position and returns to it when you switch to that provider. It does that by creating a PerProvider variable and using it when providers are first opened to set it to the origin and when switching providers it first saves the position of the old provider and then loads and sets the saved position of the new provider.

paxcut and others added 4 commits August 21, 2024 14:51
Currently, the pattern editor does not remember where the cursor is located in each provider. For example, suppose you have 2 providers in your project, and you scrolled down to line 200 in the first pattern to make some changes and remembered that the code you want to insert is in the second provider. Then you switch to the second provider, look for the code and find it in line 235. Switch back to the first one, and you are at the beginning of the file. So you again look for the line to edit paste it to realize that it needs code a few lines before the place you found it. You switch to the second provider, and you are at the top again. This gets annoying very fast.

This PR ensures that, when you return to the pattern in the editor for any of the opened providers, the cursor will still be at the same place it was when you switched to a different one. Each provider pattern saves its cursor position and returns to it when you switch to that provider.
@WerWolv WerWolv merged commit 866b956 into WerWolv:master Sep 15, 2024
1 of 15 checks passed
@paxcut paxcut deleted the perProviderCirsorForPatternEditor branch September 17, 2024 22:36
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