-
Notifications
You must be signed in to change notification settings - Fork 193
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
Added Search for Hex functionality to the unified SearchReplace dialog. #608
Conversation
385bbd9
to
8680b56
Compare
@rohitab, Could you please test this draft PR? There are five things to test:
Comment out Hex controls in Editor Search / Replace dialog here: https://github.com/MKadaner/FarManager/blob/8680b5639d6b3359674a156d0fbc86a84429e151/far/editor.cpp#L156 Rebuild and test:
Thank you in advance! |
@alabuzhev, Could you please look at this change? It is practically ready except for the testing. |
Of course. It is rather massive so probably will take a few days.
|
Sure! It is as small as I could make it. Originally, I wanted to use the dialog in Viewer as well, but then realized the change was already too big. |
82dc4fc
to
fad8ac5
Compare
@MKadaner I just built and tested version I tested out the changes you made and they seem to be working fine. The only issue I found so far is related to a hotkey in the Replace dialog of the Editor. If you press You mentioned that Hex search is UI only and not implemented in Editor, so I'm not going to report any issues related to those. As an example, in the Replace dialog in the Editor, if you select Hex search, the Replace with box accepts text input, not hex input. The focus issue #605 (comment) is still present in this release. However, it's not present in the new Hex control that you added in the Editor for testing. The cursor position issue mentioned in #607 is also present in both the Viewer and the new Hex control in the Editor. I'm not sure if you included a fix for that, so I'm reporting it just in case. I did notice a few minor issues with Help and Hex search in Viewer, but they are present in the main Far branch, and are not related to your changes. I will open separate tickets for them to avoid any confusion. Apologies for not being able to test sooner. |
@rohitab, Thank you so much for testing; incredibly helpful. Never mind the time, nobody's get paid here.
This is a bug. I will have fixed it in the next iteration (will push in a few minutes).
If it is in the Viewer, that is expected, I did not touch it. Frankly, I do not want to look there. I'd rather concentrate on replacing Viewer Search dialog with the unified one (next after this PR is merged), and the question will be moot.
Yeah! This one is an issue on its own and is pretty much independent of the dialog behavior. Since it is not a regression, let's keep track of it in #607 and I will do something about it, probably after reworking Viewer Search.
For now, I just did not touch the Replace control, since in production it will never appear together with the Hex controls, not util we implement Hex search in Editor. And this one is interesting. When I try to think through my scenarios, I am not sure whether I want to replace a hex pattern with hex or text string. I need to actually use hex search in Editor to decide. Maybe the replace option should even be independent from the search one? Another interesting question is whether hex search in Editor should scan the decoded text or the underlying file, as in the Viewer. If it searches the file content, should it still search line by line, skipping line ends, as Editor does now? I think we should start collecting requirements. @alabuzhev et al, does anybody have any suggestions? At any rate, hex search in Editor is relatively low on my priority list. |
fad8ac5
to
ca5f472
Compare
I doubt that Hex search in Editor would make much sense - Editor does not work with bytes, so such mode would be quite hard to implement properly, and implementing it halfway would only confuse people. |
:) I've actually considered the "should". I remember using Far Editor several times to patch binary files like executables or images, even recently. It's possible if one is careful. I can imagine hex search / replace could be useful in such endeavors. But I agree that this feature is of very low priority, even if it's deemed useful. |
6617ee6
to
6bb1093
Compare
Removed test scaffolding, changelog, version, rebased, squashed, ready. Thank you for the review! |
@MKadaner I've pushed a commit before noticing your latest changes, please rebase again. |
6bb1093
to
80e58e1
Compare
@alabuzhev Done! |
Thank you |
Editor Replace Button Hotkey Most dialogs in Far do not have hotkeys for the default button, since you can just press What do you think about removing the hotkey from the Replace button and assigning |
I also noticed this discrepancy. I think this is a good idea. The decision is mostly for the language maintainers, except for there is no dedicated maintainer for English localization. P.S. maybe move this discussion to, well, "Discussions?" |
Moved to Discussions: #616 |
Summary
Added Search for Hex functionality to the unified SearchReplace dialog.
References
Checklist
If not checked, I accept that this work might be rejected in favor of a different great big ineffable plan.
Details