-
Notifications
You must be signed in to change notification settings - Fork 274
GeanyLua: geany.fileinfo: Added a field for single-line comments; all 'comment' fields are renamed as in filetype definition files. #1397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Would "comment" instead of "single" be better? |
Yes, sounds better. Fixed. |
|
If the plan is to eventually use the same names as Geany, should add all three now, |
Changes will be mentioned in the list of changes on the releases page, but I do not know how many users look at the list of changes and will be able to adjust their scripts. On the other hand, new Geany versions are rarely released, and reviewing the list of changes cannot become a tedious chore :) About the length of the name: I thought of using |
It's not about "urgent", but whether renaming the fields will or can be done at all. Would be good for someone with commit privileges to just make a decision. The existing names are not self-explanatory and don't match the names used by Geany. Anyone using them would already have to check (and recheck) documentation for usage. The main reasons to leave them alone are they're shorter and might be used in existing scripts. However, plugins and scripts often require user intervention with new releases, so the change wouldn't really be unexpected. Error messages would prompt users to check documentation for updates. |
@xiota, what do you think about |
Upon further reflection, I now think field names should be switched entirely to the Geany name, immediately dropping the old names.
|
But you're the maintainer, so the final decision should be yours. I changed it and if everything is okay, then I will merge the commits and correct the commit message. |
There are these too...
Too much to change... maybe should minimize changes and revert back. I'm going to think some more about it some more... |
geanylua/glspi_doc.c
Outdated
@@ -321,8 +321,9 @@ static gint glspi_fileinfo(lua_State* L) | |||
} | |||
SetTableStr("type", FileTypeStr(name)); | |||
SetTableStr("desc", FileTypeStr(title)); | |||
SetTableStr("opener", FileTypeStr(comment_open)); | |||
SetTableStr("closer", FileTypeStr(comment_close)); | |||
SetTableStr("comment", FileTypeStr(comment_single)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about following (and associated doc change)? Everything else can stay as-is with no plans to further align names.
SetTableStr("comment_single", FileTypeStr(comment_single));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was having connection problems with github... I think comment_{single,open,close} would be good / final. It's more verbose than previously, but more clear what they are.
… 'comment' fields are renamed as in filetype definition files. Cosmetics (alignment).
Everything seems to be done. |
LGTM... Ready for @b4n review/action. Tested with script...fileinfo = geany.fileinfo()
if fileinfo then
output = "geany.fileinfo()\n"
output = output .. "name = " .. fileinfo['name'] .. "\n"
output = output .. "path = " .. fileinfo['path'] .. "\n"
output = output .. "ext = " .. fileinfo['ext'] .. "\n"
output = output .. "type = " .. fileinfo['type'] .. "\n"
output = output .. "desc = " .. fileinfo['desc'] .. "\n"
output = output .. "comment_single = " .. fileinfo['comment_single'] .. "\n"
output = output .. "comment_open = " .. fileinfo['comment_open'] .. "\n"
output = output .. "comment_close = " .. fileinfo['comment_close'] .. "\n"
output = output .. "action = " .. fileinfo['action'] .. "\n"
output = output .. "ftid = " .. fileinfo['ftid'] .. "\n"
output = output .. "encoding = " .. fileinfo['encoding'] .. "\n"
if fileinfo['bom'] then
output = output .. "bom = true\n"
else
output = output .. "bom = false\n"
end
if fileinfo['changed'] then
output = output .. "changed = true\n"
else
output = output .. "changed = false\n"
end
if fileinfo['readonly'] then
output = output .. "readonly = true\n"
else
output = output .. "readonly = false\n"
end
geany.status(output)
else
geany.status("geany.fileinfo: nil")
end |
From discussion 4174.
It's really strange: we have information about multi-line comments, but no single-line comments. Let's fix this :)