For anyone who is interested, here is my take on 4coder modal custom layer

I put some work in here, so I figured it can be nice for new users to look at it as a reference for customizing (or use it if they like the idea).
4coder_modal on gitlab.
It is still experemental and I'm updating it as I go, so don't count on it to be solid enough to not crash in the middle of your work.

Edited by nj on Reason: Moved to Gitlab
Woah, this is substantial!

I'm going to start reading this tonight to see what you've got going on here.

Are you open to questions? Would you like my notes on it?
Of caurse (for both)! also you can use anything you like from it. I love your work and I'd be happy to help it :)

Edited by nj on
Also, I hope you're not angry about me copying some of your functions to change very small things and posting it there...
Thanks for sharing this, I will be trying it out this weekend.

Edited by joe513 on
I've added a partial implementation for keyboard macros. It's still buggy and lacking (some things are not yet supported in 4coder), but I've already found it very useful when performing repeatative tasks.
You can check it out in the repo.
Added a search mode, added support for pasting into a search query (only with the search mode) o/
Also, while not working with macros it doesn't crash 4coder.

Edit: now search works partially with macros (printing won't work, only playing back).
Edit2: added also partial support for goto in macros.

Allen if you see this: adding a set_command_input procedure will make my macros sooooo happpyyyyy :D

Edited by nj on
Added "desc" command to describe a given key binding command, using the new command metadata system.
Updated the custom layer to support 4coder 4.0.27, adding the steps that I needed for the upgrade:
1
replaced `Range get_range(View_Summary *view)` with `Range get_view_range(View_Summary *view)`

1
replaced `clipboard_copy(Application_Links *app, int32_t start, int32_t end, Buffer_Summary *buffer_out, uint32_t access)` with `bool32 post_buffer_range_to_clipboard(Application_Links *app, Partition *scratch, int32_t clipboard_index, Buffer_Summary *buffer, int32_t first, int32_t one_past_last)`

1
2
replaced `bool32 get_current_name(char **name_out, int32_t *len_out)` with `global_config.user_name`
Note that the way to get the config variables changed - now you can access the global_config struct directly.

1
replaced `default_4coder_initialize(Application_Links *app)` with `default_4coder_initialize(Application_Links *app, int32_t override_font_size, bool32 override_hinting)`


Notes for Allen:
The meta generators tends to add undefined garbage to the meta tables from the example files. On Linux the linker fails silently, and the error message does not make sense. On Windows the situation is better as the linker gives meaningful error messages.

Edited by nj on
nicoco

Notes for Allen:
The meta generators tends to add undefined garbage to the meta tables from the example files. On Linux the linker fails silently, and the error message does not make sense. On Windows the situation is better as the linker gives meaningful error messages.


Ahh shoot, that's a bit of a tricky situation, but I definitely have to do something about that. Thanks for bringing it up.