
2. Also, I am wondering if I can use a reg-ex to ?fix? some files I was editing in Zeus and damaged in this way? If I could locate lines containing nothing but a CRLF, I could replace them with a <tab>CRLF. That would fix damaged files?
1. I was wondering if there is a way to stop Zeus from eliminating tab chars from my .sql files?
Unfortuantely there is no way to fix this using a search and replace, but the macro shown below will restore these missing tabs. Save the macro to the zScript\AddTab.lua file and then use the Macros, Execute Script menu and type in AddTab.lua to run the macro. It will restore the tabs to the currently active file.2. Also, I am wondering if I can use a reg-ex to ?fix? some files
I was editing in Zeus and damaged in this way?
Code: Select all
function key_macro()
-- macro only works for documents
local document = is_document()
if document == 0 then
message("This macro only works for document files!")
beep()
return
end
-- macro only works for read/write documents
local locked = is_read_only()
if locked == 1 then
message("The current document is marked as read only!")
beep()
return
end
-- disable screen updates
screen_update_disable()
-- save the current cursor
cursor_save()
-- total number of lines
local lines = get_line_count();
-- move to the fist line
set_line_pos(0)
for i = 1, lines, 1 do
-- get the line text
local line_text = get_line_text();
local length = string.len(line_text)
if length == 0 then
-- add the missing tab
print("\t")
MoveLineHome()
end
MoveLineDown()
end
-- restore original cursor
cursor_restore()
-- restore screen updates
screen_update_enable()
end
key_macro() -- run the macro