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

feat: shortcuts may provide a custom action for the intent #133

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

tauu
Copy link
Contributor

@tauu tauu commented Sep 20, 2022

This PR adds the possibility to set a custom action callback function for the intent corresponding to the shortcut. This can be useful for example, if the text to be pasted should be preprocessed before writing it to the terminal. For example special characters could cause problems could be removed.

The PR also adds handling of changes to the shortcuts property of the TerminalView. A new ShortcutManager is created in case the list of shortcuts. changes.

Furthermore it has been made easier to override default shortcuts, by adding a constructor to chose the proper modifier key for the current platform.

@codecov-commenter
Copy link

Codecov Report

Merging #133 (fefed18) into master (0e10f22) will increase coverage by 0.11%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##           master     #133      +/-   ##
==========================================
+ Coverage   51.38%   51.49%   +0.11%     
==========================================
  Files          50       50              
  Lines        3260     3270      +10     
==========================================
+ Hits         1675     1684       +9     
- Misses       1585     1586       +1     
Impacted Files Coverage Δ
lib/src/ui/shortcut/shortcuts.dart 40.54% <40.54%> (-3.91%) ⬇️
lib/src/terminal_view.dart 67.22% <70.00%> (-0.22%) ⬇️
lib/src/ui/shortcut/actions.dart 100.00% <100.00%> (+63.63%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@tauu
Copy link
Contributor Author

tauu commented Sep 20, 2022

@xtyxtyx Btw. a big thank you for adding tests and merging all the PRs so fast! :)

@xtyxtyx xtyxtyx self-assigned this Sep 20, 2022
@tauu
Copy link
Contributor Author

tauu commented Feb 1, 2023

Hello :-) Is something preventing this from being merged? Are some improvements / example to the PR required?
I noticed that a conflict for a single line is there now, not sure when that showed up. If this is the only problem, then I am happy to resolve that asap. :)

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.

None yet

3 participants