I installed 010 Editor the other day and immediately had a much better experience than with ImHex - just purchased my license. That being said, I also found a number of possible improvements (mostly minor stuff). It would be nice if these could be considered for a future release.
Text editor
Pressing Shift-Backspace does nothing, so if you’re in the middle of typing an all-caps enum member and make a typo, you need to let go of Shift, press Backspace, and then hold Shift again. Could Shift-Backspace be made to do the same as Backspace, as is also the case in e.g. Notepad++ and VS Code?
Shift-Tab only performs an unindent if you have multiple lines selected. It would be useful if this also worked for single lines - including without having anything selected at all - again like in the above editors. (I tried assigning it as a shortcut for the Format → Decrease Line Indent menu item, but pressing Shift-Tab in the “Press Shortcut” textbox changes the focus to another control rather than registering the shortcut.)
Typing {
and pressing Enter automatically indents, but }
doesn’t automatically unindent.
Even though template files get opened in a floating tab group, you can’t drag&drop additional templates onto that tab group to open those - you need to drop them on the main window instead.
Jumping to template fields doesn’t always work
If you run the following template, you’ll see that it correctly highlights both value
fields:
typedef struct
{
int value;
} Inner <style=sHeading2>;
typedef struct
{
int value;
local int prevPos = FTell();
FSeek(0x10);
Inner inner;
FSeek(prevPos);
} Outer <style=sHeading1>;
Outer outer;
However, if you place the hex editor cursor in the second field and press Ctrl-J to jump to it in the Template Results, 010 says “No template variable found.”
It works if you expand outer
in the Template Results, but because Inner
is not an on-demand structure and because the highlighting shows that it did in fact get parsed, I would expect it to work straight away.
(The main real-life use case here is structures such as Inner
getting pointed to by a file offset in Outer
. If I see the Inner
color in the hex editor, I’d like to jump to it in the template results to find the Outer
struct that references it.)
Attributes for struct Data {…}
The following doesn’t work for some reason:
struct Data <style=sHeading1>
{
};
Neither does this:
struct Data
{
} <style=sHeading1>;
However, this does:
typedef struct
{
} Data <style=sHeading1>;
Is this intentional? It would be nice if one of the non-typedef variants were possible, as this would allow us to always place the struct name before its definition rather than after - just like we’re doing for enums and functions.
Compact field positioning syntax
I’m currently templating a file format that contains lots of file offsets to structures. Right now, I have to do the following each time:
int dataPos;
local int prevPos = FTell();
FSeek(dataPos);
Data data;
FSeek(prevPos);
This gets quite tedious after a while, especially if you compare it to ImHex where you can just do this:
s32 dataPos;
Data data @ dataPos;
Would it be possible to add something similar to 010?
bool data type
The scripting language has true
and false
keywords, but no bool
data type. While we can of course just use byte
, bool
would better express the intended usage. (And although we can use typedef byte bool;
, this doesn’t give us syntax highlighting.)
Declaring variables in for loops
The following is currently not possible:
for (local int i = 0; i < 10; i++)
{
}
Allowing it would make code a bit more compact.
Reference variables
This is already possible:
void workWithItem(Item& item)
{
// Do stuff with item
}
Item items[100];
local int i;
for (i = 0; i < 100; i++)
{
workWithItem(items[i]);
}
However, this is not (syntax error):
for (i = 0; i < 100; i++)
{
local Item& item = items[i];
// Do stuff with item
}
And neither is this (“Incompatible types” error):
local Item item = items[i];
So we either need to repeat items[i]
(which could be a much longer expression) each time we want to access one of its fields, or write a function. Would it be possible to also allow reference variables?
FAlign(alignment) function
It could be useful to have a builtin function for seeking ahead to the next multiple of the given number, as some file formats have this kind of padding.
–
Overall, 010 has been great to work with so far, and I thank you for creating it.