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

Turn a group of carets into a "tab order" #19

Open
oxysoft opened this issue May 18, 2018 · 3 comments
Open

Turn a group of carets into a "tab order" #19

oxysoft opened this issue May 18, 2018 · 3 comments

Comments

@oxysoft
Copy link

oxysoft commented May 18, 2018

Let's say I have just duplicated this line so I now have this

public int { get; set }
public int { get; set }
public int { get; set }

I would like to name each property one by one, but without manually moving the caret. What I would like to do is:

  1. Position my caret before the {/after int.
  2. Activate an action to make it so that I can turn the list of carets into a list of fields.
  3. I can type in the field, then press press tab/shift-tab to go forward or backward in the list, and I could edit each of the 3 fields I had marked with my carets. Kind of like how it works for live templates.

Hope this makes sense!

@vsch
Copy link
Owner

vsch commented May 20, 2018

@oxysoft, I will have to see how this can be implemented. It requires a modal state which can interfere with other editing operation and will require being compatible with a ton of current editing states.

@oxysoft
Copy link
Author

oxysoft commented May 20, 2018

Doesn't Jetbrains' plugin API offer a way to simply use the platform's existing tab stops system?

@vsch
Copy link
Owner

vsch commented May 20, 2018

@oxysoft, the API does not have a tab stop system. It has an option for Tab to spaces and Tab Handler but only for specific applications that the API uses for its own.

The issue here is not the tabs but the modal state during which tab characters are used to traverse saved caret positions in order. This requires storing the carets and overriding the tabs. Then exiting the mode. Keeping the mode active only for the editor where it was activated.

While the mode is active, it requires updating the caret positions as the text is edited. The mode most likely has to remain active in the editor even when the current editor is switched for another, to allow navigating somewhere else to copy text and return to the original editor to paste at caret.

There are a lot of additional actions that the IDE generates during editing like re-formatting code which changes large sections of text. This I usually discover by trial and error and in many cases only when I encounter it since envisioning all these options is very difficult.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants