@elextr

a normal plugin would use document_set_filetype() but I don't know if its available in the restricted Geanylua API.

"normal" plugin? :)
I use local geanylua-ref.html. Also I tried to find document_set_filetype() in source files of Geanylua, but without success.

Maybe try something like

--- "geanylua/glspi_doc.c"
+++ "geanylua/glspi_doc.c"
@@ -36,8 +36,10 @@
 		if (!lua_isstring(L, 1))	{ return FAIL_STRING_ARG(1); }
 		fn=lua_tostring(L, 1);
 		if ( '\0' == fn[0] ) { fn = NULL; }
+		ft=lua_tostring(L, 2);
+		if ( '\0' == fn[0] ) { fn = NULL; }
 	}
-	document_new_file(fn, NULL, NULL);
+	document_new_file(fn, ft, NULL);
 	return 0;
 }

?
Function glspi_newfile, i.e. minimal effort (?). And use like

local t = geany.fileinfo();
geany.newfile("", t.type);

for untitled document/new tab.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.