Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@pskowronek
Copy link
Member

@pskowronek pskowronek commented Jun 7, 2023

Key mapping capabilities for terminal in Shortcuts prefs.

A lot of changes to achieve that - should be carefully reviewed and tested for backward compatibility especially as it comes to preferences stored in xml (action_keymap.xml, command_bar etc).

By default, no keybindings are set - this means default key binding are being used as set by JediTerm.
Terminal keybindings have different "scope" i.e. it is possible to use existing key bindings from other shortcuts.

obraz

@pskowronek pskowronek requested a review from ahadas as a code owner June 7, 2023 18:52
@pskowronek pskowronek marked this pull request as draft June 8, 2023 11:50
@pskowronek pskowronek marked this pull request as ready for review June 8, 2023 14:34
@pskowronek pskowronek force-pushed the key-bind-term-pref branch from e4d4da6 to e86dee8 Compare June 23, 2023 20:34
@ahadas ahadas force-pushed the key-bind-term-pref branch from e86dee8 to 81b715b Compare June 24, 2023 09:02
Copy link
Member

@ahadas ahadas left a comment

Choose a reason for hiding this comment

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

partial review (147 out of 181)

if (o == null || getClass() != o.getClass())
return false;
ActionId actionId1 = (ActionId) o;
return Objects.equals(actionId, actionId1.actionId);
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't we also compare the type here?

Copy link
Member Author

Choose a reason for hiding this comment

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

hmm, why?

Copy link
Member

Choose a reason for hiding this comment

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

I saw later on that in order to distinguish between, let's say 'find' for terminal and 'find' for the file table, there's code that checks the scope of the action that we look for - in case of checking a terminal action we filter out the non-terminal actions and vice versa. I would prefer to get that logic here - to say that "this" ActionId is with with terminal scope then it doesn't equal any other command that is not with terminal scope, and vice versa

Copy link
Member Author

@pskowronek pskowronek Jun 24, 2023

Choose a reason for hiding this comment

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

I will try to think about later (after fixing other remarks).

Copy link
Member Author

Choose a reason for hiding this comment

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

So, you're right that it would be better, however I guess I don't want to refactor more with this PR :/

In ActionManager#getActionInstance line 382 - this will return null if we were to check type, because this is being used in context of toolbar via ToolBar:110 that is using ToolBarAttributes#DEFAULT_TOOLBAR_ACTIONS set as Toolbar.

Copy link
Member

Choose a reason for hiding this comment

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

ok, let's leave this one out of this PR

Copy link
Member

@ahadas ahadas left a comment

Choose a reason for hiding this comment

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

still didn't review everything (175 / 181)

if (o == null || getClass() != o.getClass())
return false;
ActionId actionId1 = (ActionId) o;
return Objects.equals(actionId, actionId1.actionId);
Copy link
Member

Choose a reason for hiding this comment

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

I saw later on that in order to distinguish between, let's say 'find' for terminal and 'find' for the file table, there's code that checks the scope of the action that we look for - in case of checking a terminal action we filter out the non-terminal actions and vice versa. I would prefer to get that logic here - to say that "this" ActionId is with with terminal scope then it doesn't equal any other command that is not with terminal scope, and vice versa

@pskowronek pskowronek force-pushed the key-bind-term-pref branch from 81b715b to bded831 Compare June 24, 2023 18:44
@pskowronek
Copy link
Member Author

PR updated with fixes after review

Copy link
Member

@ahadas ahadas left a comment

Choose a reason for hiding this comment

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

complete review (so many changes..), also resolved some of the previous comments that were handled, looks good overall!

@pskowronek pskowronek force-pushed the key-bind-term-pref branch from 51af32e to 385c6b6 Compare June 24, 2023 23:00
@pskowronek
Copy link
Member Author

PR updated, what is left is #973 (comment) - as in the comment

Copy link
Member

@ahadas ahadas left a comment

Choose a reason for hiding this comment

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

one minor comment, besides that lgtm

if (o == null || getClass() != o.getClass())
return false;
ActionId actionId1 = (ActionId) o;
return Objects.equals(actionId, actionId1.actionId);
Copy link
Member

Choose a reason for hiding this comment

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

ok, let's leave this one out of this PR

@pskowronek pskowronek force-pushed the key-bind-term-pref branch from 385c6b6 to 5e66328 Compare June 25, 2023 20:14
@pskowronek
Copy link
Member Author

PR updated

@ahadas ahadas merged commit 781c081 into mucommander:master Jun 25, 2023
@ahadas ahadas linked an issue Jul 2, 2023 that may be closed by this pull request
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.

Please provide key mapping capabilities for terminal like in iTerm2

2 participants