Skip to content

Commit

Permalink
LuaFAR: fix screen artifacts after error in dialog procedure
Browse files Browse the repository at this point in the history
  • Loading branch information
shmuz committed Oct 30, 2024
1 parent b770d1f commit 8e6f8cf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions luafar/src/service.c
Original file line number Diff line number Diff line change
Expand Up @@ -4085,6 +4085,8 @@ static int far_DialogRun (lua_State *L)
if (dd->wasError)
{
free_dialog(dd);
// sometimes parts of the closed dialog are left on the screen; ACTL_COMMIT clears them
PSInfo.AdvControl(GetPluginData(L)->ModuleNumber, ACTL_COMMIT, NULL, NULL);
luaL_error(L, "error occured in dialog procedure");
}
lua_pushinteger(L, result);
Expand Down

1 comment on commit 8e6f8cf

@shmuz
Copy link
Owner Author

@shmuz shmuz commented on 8e6f8cf Oct 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code below was used from the panels and produced artifacts on the screen after error messages were closed.

local F = far.Flags
local sd = require "far2.simpledialog"
local Items = {
  { tp="dbox"; text="Title";                           },
  { tp="text"; text="Enter the text:";                 },
  { tp="edit"; name="edit1";                           },
  { tp="sep";                                          },
  { tp="butt"; centergroup=1; default=1; text="OK";    },
}

Items.proc = function(hDlg, msg, param1, param2)
  if msg == F.DN_EDITCHANGE then error"aaa" end
end

sd.New(Items):Run()

Please sign in to comment.