@b4n commented on this pull request.
> static gint glspi_activate(lua_State* L)
{
- gint idx=-1;
- if (lua_gettop(L)>0) {
- if (lua_isnumber(L,1)) {
- idx=(lua_tonumber(L,1));
- if (idx<0) { /* Negative number refers to (absolute)
GtkNotebook index */
- idx=(0-idx)-1;
- if (idx>=gtk_notebook_get_n_pages(NOTEBOOK)) {
idx=-1;}
- } else { /* A positive number refers to the
geany->documents_array index */
- idx=doc_idx_to_tab_idx(idx-1);
+ gint lua_idx = -1;
+ gint tab_idx = -1;
+
+ if (lua_gettop(L) > 0) {
+ if (lua_isnumber(L, 1)) {
shouldn't that be
[`lua_isinteger()`](https://www.lua.org/manual/5.4/manual.html#lua_isinteger)
rather than
[`lua_isnumber()`](https://www.lua.org/manual/5.4/manual.html#lua_isnumber) as
it's converted using
[`lua_tointeger()`](https://www.lua.org/manual/5.4/manual.html#lua_tointeger)
in the body? Note that I don't know the details, but there seem to be more
difference than float vs. integer.
--
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/pull/1234#pullrequestreview-2708870986
You are receiving this because you are subscribed to this thread.
Message ID: <geany/geany-plugins/pull/1234/review/[email protected]>