Skip to content

Commit

Permalink
1. Уточнение revision 12857: после вызова Plugin.Call и завершения ма…
Browse files Browse the repository at this point in the history
…кроса не производилась перерисовка редактора.

2. Документация.
  • Loading branch information
shmuz committed Feb 6, 2015
1 parent 904c472 commit b02b713
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 55 deletions.
34 changes: 0 additions & 34 deletions enc/enc_lua/luafar_manual.tsi
Expand Up @@ -1730,18 +1730,6 @@ mtime=3602340590
</article>
</node>
<node>
id=365
lv=2
dt=Text
nm=export.FreeCustomData
ctime=3485765946
mtime=3602340689
<article>
#_**This function is not called by LuaFAR**
#_
</article>
</node>
<node>
id=99
lv=2
dt=Text
Expand All @@ -1758,28 +1746,6 @@ mtime=3602340713
</article>
</node>
<node>
id=364
lv=2
dt=Text
nm=export.GetCustomData
ctime=3485765841
mtime=3509018899
<article>
#_Data = export.GetCustomData (FilePath)
#_
#_**Parameters:**
#_ FilePath: string
#_
#_**Returns:**
#_ Data: string, or nil
#_
#_**WARNING:**
#_ As of time of this writing, this function exploits an experimental
#_ feature of Far, introduced in Far 2.0 build 1588.
#_
</article>
</node>
<node>
id=101
lv=2
dt=Text
Expand Down
2 changes: 1 addition & 1 deletion plugins/luamacro/_globalinfo.lua
@@ -1,6 +1,6 @@
function export.GetGlobalInfo()
return {
Version = { 1, 0, 0, 480 },
Version = { 1, 0, 0, 481 },
MinFarVersion = { 3, 0, 0, 4252 },
Guid = win.Uuid("4EBBEFC8-2084-4B7F-94C0-692CE136894D"),
Title = "LuaMacro",
Expand Down
6 changes: 5 additions & 1 deletion plugins/luamacro/changelog
@@ -1,4 +1,8 @@
shmuel 03.02.2015 01:48:32 +0200 - build 480
shmuel 06.02.2015 17:07:16 +0200 - build 481

1. Уточнение build 476: после вызова Plugin.Call и завершения макроса не производилась перерисовка редактора.

shmuel 03.02.2015 01:48:32 +0200 - build 480

1. LuaFAR: добавлена функция far.FarClock. Документация следует.

Expand Down
32 changes: 14 additions & 18 deletions plugins/luamacro/keymacro.lua
Expand Up @@ -228,9 +228,7 @@ local function GetInputFromMacro()
return false
end

local r1,r2
while true do
r1,r2 = nil,nil
while MacroIsRunning==0 and not GetCurMacro() do
if StateStack[1] then
PopState(true)
Expand Down Expand Up @@ -260,6 +258,7 @@ local function GetInputFromMacro()
MacroIsRunning = MacroIsRunning + 1
PushState(false)
local value, handle = macro:GetValue(), macro:GetHandle()
local r1,r2
if type(value) == "userdata" then
r1,r2 = MacroStep(handle, far_FarMacroCallToLua(value))
elseif type(value) == "table" then
Expand All @@ -273,6 +272,10 @@ local function GetInputFromMacro()
macro:SetValue(nil)
MacroIsRunning = MacroIsRunning - 1

if band(macro:GetFlags(),MFLAGS_ENABLEOUTPUT) == 0 then
Import.ScrBufLock()
end

if r1 == MPRT_NORMALFINISH or r1 == MPRT_ERRORFINISH then
if band(macro:GetFlags(),MFLAGS_ENABLEOUTPUT) == 0 then
Import.ScrBufUnlock()
Expand All @@ -283,25 +286,18 @@ local function GetInputFromMacro()
end
elseif r1 == MPRT_PLUGINCALL then
KeyMacro.CallPlugin(r2, true)
elseif r1 == "acall" then
ACall(GetCurMacro(), r2)
return GetInputFromMacro() -- tail recursion
elseif r1 == "eval" then
local m = r2[1]
PushState(true)
KeyMacro.PostNewMacro(m, m.flags, r2[2], false)
return GetInputFromMacro() -- tail recursion
else
if band(macro:GetFlags(),MFLAGS_ENABLEOUTPUT) == 0 then
Import.ScrBufLock()
end
break
return r1,r2
end
end

if r1 == "acall" then
ACall(GetCurMacro(), r2)
return GetInputFromMacro() -- tail recursion
elseif r1 == "eval" then
local m = r2[1]
PushState(true)
KeyMacro.PostNewMacro(m, m.flags, r2[2], false)
return GetInputFromMacro() -- tail recursion
end

return r1,r2
end

-- (1) mf.eval (2) keypress macro (3) mf.postmacro
Expand Down
2 changes: 1 addition & 1 deletion plugins/luamacro/luamacro.rc
@@ -1,6 +1,6 @@
#include <farversion.hpp>

#define PLUGIN_BUILD 480
#define PLUGIN_BUILD 481
#define PLUGIN_DESC "Lua Macros for Far Manager"
#define PLUGIN_NAME "LuaMacro"
#define PLUGIN_FILENAME "luamacro.dll"
Expand Down

0 comments on commit b02b713

Please sign in to comment.