Skip to content

Improved indentation system#168

Merged
TheThirdOne merged 1 commit intoTheThirdOne:masterfrom
Wakeful-Cloud:master
Feb 16, 2023
Merged

Improved indentation system#168
TheThirdOne merged 1 commit intoTheThirdOne:masterfrom
Wakeful-Cloud:master

Conversation

@Wakeful-Cloud
Copy link
Contributor

This pull request adds the ability to:

  • Indent all selected lines with TAB
  • De-indent all selected lines with SHIFT + TAB
  • Deindent the line the caret is currently on

@Wakeful-Cloud
Copy link
Contributor Author

@TheThirdOne Hello again! Have you had any time to review this?

public boolean dispatchKeyEvent(KeyEvent e) {
if (JEditTextArea.this.isFocusOwner() && e.getKeyCode() == KeyEvent.VK_TAB && e.getModifiers() == 0) {
int modifiers = e.getModifiers();
if (JEditTextArea.this.isFocusOwner() && e.getKeyCode() == KeyEvent.VK_TAB
Copy link
Owner

Choose a reason for hiding this comment

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

This seems to be overcomplicating the matter a bit, but if simplified to JEditTextArea.this.isFocusOwner() && e.getKeyCode() == KeyEvent.VK_TAB CTRL + TAB results in a stack overflow for some reason.

@TheThirdOne
Copy link
Owner

I'm sorry it took me a while to get to this. I meant to get to this over both of the past weekends.

Looks good. It acts like most other text editors.

Thanks for the contribution.

@TheThirdOne TheThirdOne merged commit 06d1c60 into TheThirdOne:master Feb 16, 2023
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