Page 1 of 1

Don't debug lines with %n

Posted: Mon Oct 24, 2011 9:28 pm
by E Programmer
Jessie

I have associated this macro with my ~ key.

Lua Macro:

Code: Select all

function key_macro()
  local data_line=get_line_text()
  debug_output("line"..data_line)
end

key_macro()
When I select this line from a file:
Data%n

Zeus crashes (I lose unsaved work).

If the line is
Data%m
it's ok. It seems to be the characters '%n' that does it.
It does not crash if I don't have the debug_output in the file. So once my files are working, everything is fine after I remove all the debug_output lines. So this is a NON-CRITICAL bug. More of an FYI

I'm using Zeus 3.97-beta25

Posted: Mon Oct 24, 2011 11:31 pm
by jussij
The bad news is I can confirm this is a bug and a very serious one at that :(

The good news is I can replicate the error so it should be fixed shortly ;)

Cheers Jussi

Posted: Tue Oct 25, 2011 3:32 am
by jussij
This bug has been identified. The issue is the %n pattern is being identified as a format character.

The short term fix is to write the macro as follows:

Code: Select all

function key_macro()
  local data_line=get_line_text()

  -- %n is picked up as a format character so de-format it when found
  if (string.find(data_line, "%%n", 1, false) ~= nil) then
    data_line = string.gsub(data_line, "%n", "%%n")
    --message_box(1, data_line, "Testing")
  end
  debug_output("line"..data_line)
end

key_macro()
Shortly, there will be a new beta version released that also fixes this issue.

Cheers Jussi

Posted: Wed Oct 26, 2011 11:17 pm
by jussij
This issue should now be fixed in the beta version found here:

http://www.zeusedit.com/z300/ze397h-beta.zip

Cheers Jussi