I’d love to look over the code and get this feature added.
Here is a merge diff:
And this is the complete branch:
What do you think of adding it a macro command instead of loading in the macro directly?
The active macro file could be saved as a setting in the mode configuration files and set automatically when the mode is entered.
I would also suggest getting rid of the :
All really good ideas, I’ll try to implement those suggestions as soon as I’ve time. Thanks a lot for taking the time to give me feedback
Maybe I should give you git access so you can start a branch?
Thanks, really appreciated but in this period I’ve really little spare time, I don’t know if it’s worth giving me git access, at least not until I’m a little more comfortable with the code
Regarding the code that does the macro injections is basically this:
char c;
char *m = "{ d:125 0xc0 }"; // For example
while (cmdln_try_remove(&c)) ; // Remove all stale input
while (*m && cmdln_try_add(m)) // 'type' macro
m++;
cmdln_try_add('\0');
return ui_process_syntax();
I think what is needed to remove this abomination is to decouple the syntax process from the command line management, so maybe like adding a function to programmatically send a command/macro to be processed (and also add that to the commandline history ?)
One last question: for bug/fixes/code add like the one we are discussing here, is this a good approach for you or it would be better to open a new github issue and track everithing there ? I’m asking because I know it’s difficult/time consuming to follow several different sources and I want to let you wast as little time as possible.