-
Notifications
You must be signed in to change notification settings - Fork 67
Open
Description
I have an object I am working on that works with lua files, and I notice that when I open the file in the text editor, the filename and title are set with the .lua extension, but text is all grey --
but then if I save the file, the syntax highlighting is automatically enabled, which is really useful.
Is there a filetype attribute or object_method I can call so that the "jed" object knows to use syntax highlighting when the file is first opened?
Here is my dbclick function:
void oluajit_dblclick(t_oluajit *x)
{
if (x->t_editor)
object_attr_setchar(x->t_editor, gensym("visible"), 1);
else
{
x->t_editor = (t_object *)object_new(CLASS_NOBOX, gensym("jed"), x, 0);
if( x->filename != "" ){
object_method(x->t_editor, gensym("settext"), *(x->t_text), gensym("utf-8"));
object_method(x->t_editor, gensym("filename"), x->filename.c_str(), x->pathID );
object_attr_setsym(x->t_editor, gensym("title"), gensym(x->filename.c_str()) );
object_attr_setchar(x->t_editor, gensym("scratch"), 0);
}
else
{
object_attr_setsym(x->t_editor, gensym("title"), gensym("untitled.lua"));
object_attr_setchar(x->t_editor, gensym("scratch"), 1);
}
object_method(x->t_editor, gensym("openwindow"));
}
}
Metadata
Metadata
Assignees
Labels
No labels