I didn't try it, but if you change the name of the yeet buffer from
*yeet* to
yeet.c (create it with this name), than the
begin_buffer hook should set it up as a code buffer. Otherwise you might be able to set it like this (once again I haven't tested it):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 | static Buffer_ID
loco_get_yeet_buffer(Application_Links *app)
{
String_Const_u8 yeet_name = string_u8_litexpr("*yeet*");
Buffer_ID yeet_buffer = get_buffer_by_name(app, yeet_name, Access_Always);
if (!buffer_exists(app, yeet_buffer))
{
yeet_buffer = create_buffer(app, yeet_name, BufferCreate_AlwaysNew);
buffer_set_setting(app, yeet_buffer, BufferSetting_Unimportant, true);
/* Add this line. */
buffer_set_layout(app, yeet_buffer, layout_virt_indent_literal_generic);
}
return yeet_buffer;
}
|
This assumes that the
begin_buffer hook runs before
create_buffer returns which I haven't tested.