Skip to content

Commit

Permalink
Release 4.0.6 version
Browse files Browse the repository at this point in the history
  • Loading branch information
adonais committed Oct 13, 2023
1 parent f7b1f7f commit 9488877
Show file tree
Hide file tree
Showing 132 changed files with 19,216 additions and 1,125 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ all:
@if exist "$(MAKEDIR)\src\3rdparty\chardet\Makefile" cd "$(MAKEDIR)\src\3rdparty\chardet" && $(MAKE) /NOLOGO /$(MAKEFLAGS)
@if exist "$(MAKEDIR)\src\3rdparty\qrencode\Makefile" cd "$(MAKEDIR)\src\3rdparty\qrencode" && $(MAKE) /NOLOGO /$(MAKEFLAGS)
@if exist "$(MAKEDIR)\src\3rdparty\tinyexpr\Makefile" cd "$(MAKEDIR)\src\3rdparty\tinyexpr" && $(MAKE) /NOLOGO /$(MAKEFLAGS)
@if exist "$(MAKEDIR)\src\3rdparty\expat\Makefile" cd "$(MAKEDIR)\src\3rdparty\expat" && $(MAKE) /NOLOGO /$(MAKEFLAGS)
@if exist "$(MAKEDIR)\src\3rdparty\scintilla\Makefile" cd "$(MAKEDIR)\src\3rdparty\scintilla" && $(MAKE) /NOLOGO /$(MAKEFLAGS)
cd "$(MAKEDIR)\src"
@$(MAKE) /NOLOGO /$(MAKEFLAGS)
Expand Down Expand Up @@ -52,6 +53,7 @@ clean:
@if exist "$(MAKEDIR)\src\3rdparty\chardet\Makefile" cd "$(MAKEDIR)\src\3rdparty\chardet" && $(MAKE) /NOLOGO /$(MAKEFLAGS) clean
@if exist "$(MAKEDIR)\src\3rdparty\qrencode\Makefile" cd "$(MAKEDIR)\src\3rdparty\qrencode" && $(MAKE) /NOLOGO /$(MAKEFLAGS) clean
@if exist "$(MAKEDIR)\src\3rdparty\tinyexpr\Makefile" cd "$(MAKEDIR)\src\3rdparty\tinyexpr" && $(MAKE) /NOLOGO /$(MAKEFLAGS) clean
@if exist "$(MAKEDIR)\src\3rdparty\expat\Makefile" cd "$(MAKEDIR)\src\3rdparty\expat" && $(MAKE) /NOLOGO /$(MAKEFLAGS) clean
@if exist "$(MAKEDIR)\src\3rdparty\scintilla\Makefile" cd "$(MAKEDIR)\src\3rdparty\scintilla" && $(MAKE) /NOLOGO /$(MAKEFLAGS) clean
@if exist "$(MAKEDIR)\plugins\pdfview\Makefile" cd "$(MAKEDIR)\plugins\pdfview" && $(MAKE) /NOLOGO /$(MAKEFLAGS) clean
cd "$(MAKEDIR)\src"
Expand Down
5 changes: 4 additions & 1 deletion conf/conf.d/eu_accel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ function eu_accel.loadaccel()
" {bit.bor(FVIRTKEY,FCONTROL,FALT), VK_F6, IDM_FORMAT_COMPRESS_JSON},\n",
" {bit.bor(FVIRTKEY,FCONTROL), VK_F7, IDM_FORMAT_REFORMAT_JS},\n",
" {bit.bor(FVIRTKEY,FCONTROL,FALT), VK_F7, IDM_FORMAT_COMPRESS_JS},\n",
" {bit.bor(FVIRTKEY,FCONTROL), VK_F12, IDM_FORMAT_REFORMAT_XML},\n",
" {bit.bor(FVIRTKEY,FCONTROL,FALT), VK_F12, IDM_FORMAT_COMPRESS_XML},\n",
" {bit.bor(FVIRTKEY,FCONTROL), VK_F8, IDM_FORMAT_RUN_SCRIPT},\n",
" {bit.bor(FVIRTKEY,FCONTROL,FALT), VK_F8, IDM_FORMAT_BYTE_CODE},\n",
" {bit.bor(FVIRTKEY), VK_F10, IDM_FORMAT_WHOLE_FILE},\n",
Expand Down Expand Up @@ -207,7 +209,8 @@ function eu_accel.loadaccel()
end
local m_len = tonumber(#my_code)
if (m_len ~= nil) then
if (m_len < 175) then
--print("m_len = " .. m_len)
if (m_len < 178) then
eu_core.euapi.eu_reset_accs_mask()
end
local m_accel = eu_core.ffi.new("ACCEL[?]", m_len, {})
Expand Down
27 changes: 9 additions & 18 deletions conf/conf.d/eu_conf.lua
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ function eu_conf.loadconf()
" margin_right = 2000,\n" ..
" margin_bottom = 2000\n" ..
"}\n" ..
"-- titlebar default setting\n" ..
"titlebar = {\n" ..
" icon = true,\n" ..
" name = true,\n" ..
" path = true\n" ..
"}\n" ..
"-- hyperlink hotspot default setting\n" ..
"hyperlink_detection = true\n" ..
"-- automatically cached file (size < 200MB)\n" ..
Expand All @@ -176,20 +182,8 @@ function eu_conf.loadconf()
eu_code = dofile(file)
end
-- Add new preference
if (update_file_notify == nil) then
update_file_notify = 0
end
if (enable_runtime_logging == nil) then
enable_runtime_logging = false
end
if (process_customized == nil) then
process_customized = {}
end
if (history_mask == nil) then
history_mask = 44711
end
if (code_hint_show_enable == nil) then
code_hint_show_enable = true;
if (titlebar == nil) then
titlebar = {["icon"] = true, ["name"] = true, ["path"] = true}
end
local m_config = eu_core.ffi.new("struct eu_config", {
newfile_eols,
Expand Down Expand Up @@ -248,6 +242,7 @@ function eu_conf.loadconf()
{calltip.enable, calltip.rgb},
{complete.enable, complete.characters, complete.snippet},
{printer.header, printer.footer, printer.color_mode, printer.zoom,{printer.margin_left, printer.margin_top, printer.margin_right, printer.margin_bottom}},
{titlebar.icon, titlebar.name, titlebar.path},
hyperlink_detection,
cache_limit_size,
{app_upgrade.enable, app_upgrade.flags, app_upgrade.msg_id, app_upgrade.last_check, app_upgrade.url},
Expand All @@ -256,10 +251,6 @@ function eu_conf.loadconf()
m_reserved_0,
m_reserved_1
})
-- Compatible with previous versions
if (m_config ~= nil and m_config.eu_complete.characters == 0) then
m_config.eu_complete.characters = 1
end
eu_conf.fill_actions(m_config)
eu_conf.fill_customize(m_config)
if (not eu_core.euapi.eu_config_ptr(m_config)) then
Expand Down
23 changes: 23 additions & 0 deletions conf/conf.d/eu_core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ typedef struct _print_set
RECT rect;
}print_set;

typedef struct _titlebar_set
{
bool icon;
bool name;
bool path;
}titlebar_set;

typedef struct _caret_set
{
int blink;
Expand Down Expand Up @@ -154,6 +161,7 @@ struct eu_config
calltip_set eu_calltip;
complete_set eu_complete;
print_set eu_print;
titlebar_set eu_titlebar;
bool m_hyperlink;
int m_limit;
upgrade_set upgrade;
Expand Down Expand Up @@ -234,6 +242,17 @@ struct rb_root
struct rb_node *rb_node;
};

struct opt_format
{
bool no_c;
bool no_p;
bool no_f;
bool no_x;
bool no_t;
bool no_d;
bool no_a;
};

typedef struct rb_root eutype_t;
typedef int (*init_before_ptr)(void *pnode);
typedef int (*init_after_ptr)(void *pnode);
Expand Down Expand Up @@ -332,6 +351,9 @@ bool eu_theme_ptr(struct eu_theme *ptheme, bool init);
bool eu_accel_ptr(ACCEL *paccel);
bool eu_toolbar_ptr(eue_toolbar *pdata, int num);
bool eu_exist_path(const char *path);
bool eu_xml_pretty(void *ptr, struct opt_format *opt);

// crt 函数
char *_fullpath(char *buf, const char *path, size_t maxlen);

// all doctype callbacks
Expand Down Expand Up @@ -407,6 +429,7 @@ int on_doc_click_list_jmp(void *pnode);
int on_doc_click_list_jump_sh(void *pnode);
int on_doc_click_tree_sql(void *pnode);
int on_doc_click_tree_json(void *pnode);
int on_doc_click_tree_xml(void *pnode);
int on_doc_click_tree_redis(void *pnode);

/* lua脚本接口支持, 对各类关键字着色 */
Expand Down
32 changes: 27 additions & 5 deletions conf/conf.d/eu_docs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ if (not eu_core.file_exists(user_file)) then
" DOCTYPE_LATEX = 40,\n",
" DOCTYPE_VERILOG = 41,\n",
" DOCTYPE_PASCAL = 42,\n",
" DOCTYPE_TCL = 43,\n",
" }\n",
" local ffi_null = eu_core.ffi.cast(\"void *\", nil)\n",
" local docs_t = eu_core.ffi.new (\"doctype_t[?]\", i,\n",
Expand Down Expand Up @@ -786,6 +787,26 @@ if (not eu_core.file_exists(user_file)) then
" ffi_null,\n",
" },\n",
" {\n",
" e.DOCTYPE_TCL,\n",
" \"tcl\",\n",
" \";*.tcl;*.itcl;*.tm;\",\n",
" \"Tcl Script\",\n",
" \"tcl.snippets\",\n",
" 0,\n",
" -1,\n",
" ffi_null,\n",
" ffi_null,\n",
" ffi_null,\n",
" ffi_null,\n",
" eu_core.euapi.on_doc_keyup_general,\n",
" eu_core.euapi.on_doc_cpp_like,\n",
" ffi_null,\n",
" ffi_null,\n",
" ffi_null,\n",
" ffi_null,\n",
" ffi_null,\n",
" },\n",
" {\n",
" e.DOCTYPE_TXT,\n",
" ffi_null,\n",
" \";*.txt;\",\n",
Expand Down Expand Up @@ -867,22 +888,22 @@ if (not eu_core.file_exists(user_file)) then
" },\n",
" {\n",
" e.DOCTYPE_XML,\n",
" ffi_null,\n",
" \"xml\",\n",
" \";*.xml;*.xsl;*.svg;*.xul;*.xsd;*.dtd;*.xslt;*.axl;*.xrc;*.rdf;*.manifest;*.vcproj;*.vcxproj;*.filters;*.fb2;\",\n",
" \"XML\",\n",
" \"xml.snippets\",\n",
" 0,\n",
" -1,\n",
" ffi_null,\n",
" eu_core.euapi.on_doc_init_tree,\n",
" eu_core.euapi.on_doc_init_after_xml,\n",
" ffi_null,\n",
" ffi_null,\n",
" eu_core.euapi.on_doc_keyup_general,\n",
" eu_core.euapi.on_doc_xml_like,\n",
" ffi_null,\n",
" ffi_null,\n",
" ffi_null,\n",
" ffi_null,\n",
" eu_core.euapi.on_doc_reload_tree_xml,\n",
" eu_core.euapi.on_doc_click_tree_xml,\n",
" ffi_null,\n",
" },\n",
" {\n",
Expand Down Expand Up @@ -1074,7 +1095,8 @@ end
function fill_my_docs()
local my_doc_config = user_docs.get_docs()
local my_size = eu_core.ffi.sizeof(my_doc_config)/eu_core.ffi.sizeof("doctype_t")
if (my_size < 43) then
--print("my_size = " .. my_size)
if (my_size < 44) then
eu_core.euapi.eu_reset_docs_mask()
end
for i=0,my_size-1 do
Expand Down
8 changes: 4 additions & 4 deletions conf/conf.d/eu_example.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ local ffi = require('ffi')
local euapi = ffi.load(ffi.os == "Windows" and "euapi.dll")
ffi.cdef[[
wchar_t * __stdcall utf8_to_utf16(const char *utf8, size_t *out_len);
wchar_t* eu_utf8_utf16(const char *utf8, size_t *out_len);
int MessageBoxW(void *w, const wchar_t *txt, const wchar_t *cap, uint32_t type);
void free(void *);
int MessageBoxW(void *w, const wchar_t *txt, const wchar_t *cap, int type);
]]
-- UTF-8 to UTF-16
local function U16(input)
local wstr = euapi.utf8_to_utf16(input, nil)
local wstr = euapi.eu_utf8_utf16(input, nil)
ffi.gc(wstr,(function(self)
if wstr ~= nil then ffi.C.free(wstr) end
print("call gc, goodbye!")
end))
return wstr
end
ffi.C.MessageBoxW(nil, U16("你好, Skylark Edit!"), U16("测试:"), 0)
ffi.C.MessageBoxW(nil, U16("你好, 世界!"), U16("Skylark Editor:"), 0)
]=]
2 changes: 2 additions & 0 deletions conf/conf.d/eu_sci.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3449,6 +3449,8 @@ IDM_FORMAT_REFORMAT_JSON = 42250
IDM_FORMAT_COMPRESS_JSON = 42251
IDM_FORMAT_REFORMAT_JS = 42254
IDM_FORMAT_COMPRESS_JS = 42255
IDM_FORMAT_REFORMAT_XML = 44751
IDM_FORMAT_COMPRESS_XML = 44752
IDM_FORMAT_WHOLE_FILE = 42252
IDM_FORMAT_RANGLE_STR = 42253
IDM_FORMAT_RUN_SCRIPT = 42406
Expand Down
35 changes: 0 additions & 35 deletions conf/conf.d/eu_theme.lua
Original file line number Diff line number Diff line change
Expand Up @@ -553,41 +553,6 @@ function eu_theme.load_default(name)
dofile(file)
tname = name
end
if (xmlsection_font == nil) then
xmlsection_font = "Consola"
xmlsection_fontsize = 11
xmlsection_color = 0xC972C9
xmlsection_bgcolor = 0x00000000
xmlsection_bold = 1
end
if (results_font == nil) then
results_font = "Consola"
results_fontsize = 11
results_color = keywords_color
results_bgcolor = number_color
results_bold = 0
end
if (bracesection_font == nil) then
bracesection_font = "Consola"
bracesection_fontsize = 11
bracesection_color = 0x000000FF
bracesection_bgcolor = text_bgcolor
bracesection_bold = 1
end
if (nchistory_font == nil) then
nchistory_font = "Consola"
nchistory_fontsize = 11
nchistory_color = 0x0080FF
nchistory_bgcolor = 0x00A000
nchistory_bold = 0
end
if (dochistory_font == nil) then
dochistory_font = "Consola"
dochistory_fontsize = 11
dochistory_color = 0x0080FF
dochistory_bgcolor = 0x00A000
dochistory_bold = 0
end
local m_file = eu_core.ffi.new('char[260]')
eu_core.ffi.C._fullpath(m_file, file, 260)
local m_theme = eu_core.ffi.new("struct eu_theme", {m_file, tname,
Expand Down
48 changes: 48 additions & 0 deletions conf/conf.d/snippets/tcl.snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
###########################################################################
# SKYLARK SNIPPETS #
###########################################################################
snippet for "for... (for)" b
for {${1:set i 0}} {${2:$i < $n}} {${3:incr i}} {
$4
}
$0
endsnippet

snippet foreach "foreach... (foreach)"
foreach ${1:var} ${2:$list} {
$3
}
$0
endsnippet

snippet if "if... (if)" b
if {${1:condition}} {
$2
}
$0
endsnippet

snippet proc "proc... (proc)" b
proc ${1:name} {${2:args}} \
{
$3
}
$0
endsnippet

snippet switch "switch... (switch)" b
switch ${1:-exact} -- ${2:$var} {
${3:match} {
$4
}
default {$5}
}
$0
endsnippet

snippet while "while... (while)" b
while {${1:condition}} {
$2
}
$0
endsnippet
Loading

0 comments on commit 9488877

Please sign in to comment.