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

🚀 功能建议:can we hold on the previous result if selected text is empty? #371

Closed
4 tasks done
yam-liu opened this issue Jan 29, 2024 · 5 comments
Closed
4 tasks done
Assignees
Labels
enhancement New feature or request fixed in next release The issue will be closed once next release is available

Comments

@yam-liu
Copy link
Contributor

yam-liu commented Jan 29, 2024

请先确认以下事项

  • 已仔细阅读了 README
  • issues 页面搜索过(包括已关闭的 issue),未发现类似功能建议
  • Easydict 已升级到 最新版本

功能描述

if no text is selected, and trigger the selectTextTranslate, can we just show the window and the previous result?
CleanShot 2024-01-29 at 14 27 32@2x

使用场景

To get myself remember less shortcuts, I only give 'Select Text Translate' a shortcut, let's say, option+d. Sometimes, focus may get dismissed accidentally, if I press option+d again, the prev result got cleared, I must select context again or type it again.

实现方案(可选)

The expected behavior is when option+d pressed, check if any selected text exists, if not, just showing the previous result and making the previous selectedText selected. If I want to search other words, I can just start typing. It's a win-win, suitable for two different scenarios.

CleanShot 2024-01-29 at 14 27 32@2x
Is replacing

self.selectedText = [text trim] ?: @"";

with

self.selectedText = [text trim] ?: self.selectedText;

almost all the work? anythings else to consider?

是否愿意提交 PR 实现该功能

  • 我愿意提交 PR
@yam-liu yam-liu added the enhancement New feature or request label Jan 29, 2024
Copy link

Hello yam-liu, Thank you for your first issue contribution 🎉

@tisfeng
Copy link
Owner

tisfeng commented Jan 29, 2024

Your suggestion is good, maybe we can add an option in the settings to allow the user to choose whether to display the previous content or clear it when the selected text is empty.

image

@yangg
Copy link

yangg commented Jan 30, 2024

同样不想清空,因为只使用一个快捷键,没有给 Input Translate 单独一个快捷键。

@yam-liu
Copy link
Contributor Author

yam-liu commented Jan 30, 2024

同样不想清空,因为只使用一个快捷键,没有给 Input Translate 单独一个快捷键。

Just wait for #375 to be merged.

@tisfeng tisfeng added the fixed in next release The issue will be closed once next release is available label Feb 4, 2024
@tisfeng
Copy link
Owner

tisfeng commented Feb 9, 2024

2.6.0 新版本已提供设置项。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fixed in next release The issue will be closed once next release is available
Projects
None yet
Development

No branches or pull requests

3 participants