Skip to content

Commit e74c3a3

Browse files
committed
GeanyLua: geany.fileinfo: Added a field for single-line comments; all 'comment' fields are renamed as in filetype definition files. Cosmetics (alignment).
1 parent a10d86b commit e74c3a3

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

geanylua/docs/geanylua-ref.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,8 +544,9 @@
544544
<tr><td width="5%"></td><td><tt>ext</tt> </td><td> -- The file extension, including the dot, e.g. "<b>.DLL</b>" or "<b>.txt</b>"</td></tr>
545545
<tr><td width="5%"></td><td><tt>type</tt> </td><td> -- A one-word description of the filetype, e.g. "<b>C</b>" or "<b>Python</b>".</td></tr>
546546
<tr><td width="5%"></td><td><tt>desc</tt> </td><td> -- A longer description of the filetype, e.g. "<b>Lua source file</b>" or "<b>Cascading StyleSheet</b>".</td></tr>
547-
<tr><td width="5%"></td><td><tt>opener</tt> </td><td> -- The string used to begin a comment, e.g. "<b class="desc">&lt;!--</b>".</td></tr>
548-
<tr><td width="5%"></td><td><tt>closer</tt> </td><td> -- The string used to end a comment, e.g. "<b class="desc">--&gt;</b>".</td></tr>
547+
<tr><td width="5%"></td><td><tt>comment_single</tt> </td><td> -- The string used for a single-line comment, e.g. "<b class="desc">//</b>".</td></tr>
548+
<tr><td width="5%"></td><td><tt>comment_open</tt> </td><td> -- The string used to begin a multi-line comment, e.g. "<b class="desc">&lt;!--</b>".</td></tr>
549+
<tr><td width="5%"></td><td><tt>comment_close</tt> </td><td> -- The string used to end a multi-line comment, e.g. "<b class="desc">--&gt;</b>".</td></tr>
549550
<tr><td width="5%"></td><td><tt>action</tt> </td><td> -- The action command as executed by the context menu</td></tr>
550551
<!--
551552
<tr><td width="5%"></td><td><tt>compiler</tt> </td><td> -- The command used to compile this type of file.</td></tr>

geanylua/glspi_doc.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -319,22 +319,23 @@ static gint glspi_fileinfo(lua_State* L)
319319
SetTableStr("name", "")
320320
SetTableStr("path", "")
321321
}
322-
SetTableStr("type", FileTypeStr(name));
323-
SetTableStr("desc", FileTypeStr(title));
324-
SetTableStr("opener", FileTypeStr(comment_open));
325-
SetTableStr("closer", FileTypeStr(comment_close));
326-
SetTableStr("action", FileTypeStr(context_action_cmd));
322+
SetTableStr("type", FileTypeStr(name));
323+
SetTableStr("desc", FileTypeStr(title));
324+
SetTableStr("comment_single", FileTypeStr(comment_single));
325+
SetTableStr("comment_open", FileTypeStr(comment_open));
326+
SetTableStr("comment_close", FileTypeStr(comment_close));
327+
SetTableStr("action", FileTypeStr(context_action_cmd));
327328
/*
328329
SetTableStr("compiler", BuildCmdStr(compiler));
329330
SetTableStr("linker", BuildCmdStr(linker));
330331
SetTableStr("exec", BuildCmdStr(run_cmd));
331332
SetTableStr("exec2", BuildCmdStr(run_cmd2));
332333
*/
333-
SetTableNum("ftid", GPOINTER_TO_INT(doc->file_type?doc->file_type->id:GEANY_FILETYPES_NONE));
334-
SetTableStr("encoding", StrField(doc,encoding));
335-
SetTableBool("bom",doc->has_bom);
336-
SetTableBool("changed",doc->changed);
337-
SetTableBool("readonly",doc->readonly);
334+
SetTableNum("ftid", GPOINTER_TO_INT(doc->file_type?doc->file_type->id:GEANY_FILETYPES_NONE));
335+
SetTableStr("encoding", StrField(doc,encoding));
336+
SetTableBool("bom", doc->has_bom);
337+
SetTableBool("changed", doc->changed);
338+
SetTableBool("readonly", doc->readonly);
338339
return 1;
339340
}
340341

0 commit comments

Comments
 (0)