far2l
far2l copied to clipboard
Implement hex editor
Something like Hexitor Windows Far plug in: https://plugring.farmanager.com/plugin.php?l=ru&pid=912
Another option is to use far2m, it has hex editor: https://github.com/shmuz/far2m https://habr.com/ru/articles/845998/comments/#comment_27388670
Another option is to use hiew (best thing in the world as for me), but it has some problems in Wine: https://bugs.winehq.org/show_bug.cgi?id=57281
And one more option is to build and use beye (ex biew): https://github.com/unxed/beye
@unxed 3 последние ссылки почему ссылаются на winehq
@unxed 3 последние ссылки почему ссылаются на winehq
Спасибо, поправил.
Пример как может работать уже сейчас в FAR2M, в hex моде нажал F3 я вошёл в режим редактирования байтов, чтобы проапдейтить файл - нажал F9, если хотим отменить ESC (хоткеи и поведение как в Hiew) :) всё это работает благодаря встроенному движку LUA.
https://github.com/user-attachments/assets/f2203a75-2465-409d-9824-985478cb8efb
Out of curiosity I made it in python (PR #2637) and what surprised me is that it works faster than the charmap plugin (the idea of operation is based on the hexitor plugin).
At the moment there are no functions (F5-goto, F7-search, ..) and no editing of byte values, but ... I don't know how to read the shift/ctrl/alt key presses so that I can change the descriptions of the function keys. far3 calls the dialogue handling functions with the DN_CONTROLINPUT parameter, and far2 doesn't have it.
Please help (@unxed @akruphi) - indicating the code in far2l itself would be appreciated
I've ported this plugin to FarL2; a working version is available at https://github.com/m32/far2lhexitor
The following still needs to be added:
- save_as (Shift+F2)
- color selection in the settings dialog. It appears that the GetColorDialog function in the pick_color.hpp file is not available for plugins.
I've ported this plugin to FarL2; a working version is available at https://github.com/m32/far2lhexitor
Very fine!!! 👍 @m32 thank you!!!
May be you also add info about it in https://github.com/elfmz/far2l/#useful3party or are you planning to implement it directly in far2l master?
Note 1: now hexitor show file with ANSI codepage and by F8 available switch only ANSI->OEM->1200-> (Shift+F8 and other codepages not available). But now usually binaries has UTF-8 strings inside. Please, if possible, add UTF-8 codepage.
Also Find sequence (via F7) work only with Hex / ANSI / OEM / UTF16) and not understand Esc. Please add here UTF-8.
Note 2: when I open file from panel via F11->Hex editor I can not switch by F12 / Ctrl+Tab and after close Hex editor in panel current file changed to .. 😢
Meanwhile, I added it in my repo, I think it will be better if it is in far2l itself - if someone uses far, they probably need a hexadecimal editor at hand. What is your opinion @elfmz ?
bugs :) - I just launched it, but now that it's there, it can be improved.
By the way:
-
fardialog.cpp - I don't like enumerations when creating dialogs, so I added a few classes and only provide what interests me, and the positioning and sizing are handled automatically - the idea is similar to wxWidgets. What do you think about adding this file to utils?
-
the color picker frame far2l/src should be in utils, otherwise you have to create the dialog yourself each time
Current file mark on panel is moved to 1st line after hex editor is closed.
PS: So cool! Thanks a lot. Dreaming of having it merged as one of default plugins
added to main repo as https://github.com/elfmz/far2l/pull/2866
- Hexitor must have a fixed number of bytes per character, so UTF-8 encoding is not supported in display/edit or search.
- Hexitor is dialog-based, although it looks like a view/editor, so it's impossible to use F12 to switch to another window.
I fixed an error on exit and the current file would jump to the first one on the list.
Does utf8 limitation is also for docs? Russian text is broken now as it was converted from win1252, not from win1251 as it should
- Hexitor is dialog-based, although it looks like a view/editor, so it's impossible to use F12 to switch to another window.
Non-modal dialogs works in far2m and I hope I will can backport this functionality to far2l.
I changed the codepage for readme_ru.txt, now it looks correct
I changed the codepage for readme_ru.txt, now it looks correct
Thank you!
Same codepage mismatch in hexitor/ChangeLog, if possible please fix it.
ChangeLog properly converted
There are a few elements I don't know how to deal with: src/file.cpp: // TODO implement save as src/settings.cpp: // TODO: Implement color selection dialog src/settings.cpp: // TODO pick_color inaccessibile for plugins ? src/goto_dlg.cpp: // TODO implement checks uppon return src/goto_dlg.cpp: // TODO manage history in aHist src/editor.cpp: // TODO implement paste from keyboard
Something like Hexitor Windows Far plug in: https://plugring.farmanager.com/plugin.php?l=ru&pid=912
Done