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

Add command: Join Lines #50

Open
justcla opened this issue Sep 9, 2016 · 1 comment
Open

Add command: Join Lines #50

justcla opened this issue Sep 9, 2016 · 1 comment

Comments

@justcla
Copy link
Owner

justcla commented Sep 9, 2016

IntelliJ command: Smart Line Join
Suggested shortcut: Ctrl+Shift+J

Brings previous line up to current line.
Removes redundant whitespace.

Clever trick: If joining a variable assignment onto code that has just declared the variable, will merge the variable declaration and assignment together (includes removing any redundant variable declaration and removing semi-colon).
This should effectively reverse a "Split variable declaration and assignment" code refactoring.

@justcla
Copy link
Owner Author

justcla commented Dec 19, 2016

I have created the JoinLines command and hooked it up to Ctrl+Shift+J.

It just does editorOperations to MoveToEndOfLine, Delete, then DeleteHorizontalWhitespace.

Todo:

  • Include it in a single Undo transaction
  • Restore the caret to its original location

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

No branches or pull requests

1 participant