From 789004ea2c41f926d98d0a8546bd85c1a9a7b71f Mon Sep 17 00:00:00 2001 From: George Sokianos Date: Mon, 10 Oct 2022 19:06:19 +0100 Subject: [PATCH] Updates and fixes for the latest available code, for 2.1 release --- Makefile.mos | 23 +++++++----- Makefile.os4 | 20 ++++++---- README_Amiga.md | 71 +++++++++++++++++++++++++++-------- data/core/common.lua | 2 +- data/core/start.lua | 3 +- data/plugins/language_md.lua | 1 + data/plugins/treeview.lua | 4 +- src/api/api.c | 4 +- src/api/dirmonitor/mos.c | 9 +++++ src/api/dirmonitor/os4.c | 9 +++++ src/dirmonitor.o | Bin 3648 -> 0 bytes src/main.c | 10 ++++- 12 files changed, 116 insertions(+), 40 deletions(-) create mode 100644 src/api/dirmonitor/mos.c create mode 100644 src/api/dirmonitor/os4.c delete mode 100644 src/dirmonitor.o diff --git a/Makefile.mos b/Makefile.mos index 02171eb8..be71472b 100644 --- a/Makefile.mos +++ b/Makefile.mos @@ -5,19 +5,21 @@ # LiteXL_OBJ := \ - src/dirmonitor.o src/main.o src/rencache.o src/renderer.o \ - src/renwindow.o src/api/api.o src/api/regex.o \ - src/api/renderer.o src/api/system.o src/platform/morphos.o + src/main.o src/rencache.o src/renderer.o src/renwindow.o \ + src/api/api.o src/api/dirmonitor.o \ + src/api/regex.o src/api/renderer.o src/api/system.o \ + src/api/utf8.o src/platform/morphos.o \ + src/api/dirmonitor/mos.o outfile := lite compiler := gcc cxxcompiler := g++ -INCPATH := -Isrc -Ilib/dmon -I/sdk/gg/usr/local/include/SDL2 -I/sdk/gg/usr/include/freetype -I/sdk/gg/usr/include/lua5.2 -DFLAGS := -D__USE_INLINE__ -DLITE_XL_DATA_USE_EXEDIR +INCPATH := -Isrc -Ilib/dmon -I/sdk/gg/usr/local/include/SDL2 -I/sdk/gg/usr/include/freetype -I/sdk/gg/usr/include/lua5.4 +DFLAGS := -D__USE_INLINE__ CFLAGS := -Wall -Wwrite-strings -O2 -noixemul -g -std=gnu11 -fno-strict-aliasing -LFLAGS := -noixemul -lpcre2 -lSDL2 -llua52 -lagg -lfreetype -lm -lc -L/usr/local/lib +LFLAGS := -noixemul -lpcre2 -lSDL2 -llua54 -lagg -lfreetype -lm -lc -L/usr/local/lib .PHONY: LiteXL clean release @@ -38,10 +40,8 @@ LiteXL: $(LiteXL_OBJ) @echo "Compiling $<" @$(compiler) -c $< -o $*.o $(CFLAGS) $(INCPATH) $(DFLAGS) -src/dirmonitor.o: src/dirmonitor.c src/platform/morphos.h - src/main.o: src/main.c src/api/api.h src/rencache.h \ - src/renderer.h src/platform/morphos.h src/dirmonitor.h + src/renderer.h src/platform/morphos.h src/rencache.o: src/rencache.c @@ -59,6 +59,11 @@ src/api/system.o: src/api/system.c src/platform/morphos.o: src/platform/morphos.c +src/api/dirmonitor.o: src/api/dirmonitor.c src/api/dirmonitor/mos.c + +src/api/utf8.o: src/api/utf8.c + +src/api/dirmonitor/mos.o: src/api/dirmonitor/mos.c diff --git a/Makefile.os4 b/Makefile.os4 index 8302a1b0..e0fb61f9 100644 --- a/Makefile.os4 +++ b/Makefile.os4 @@ -5,9 +5,11 @@ # LiteXL_OBJ := \ - src/dirmonitor.o src/main.o src/rencache.o src/renderer.o \ - src/renwindow.o src/api/api.o src/api/regex.o \ - src/api/renderer.o src/api/system.o src/platform/amigaos4.o + src/main.o src/rencache.o src/renderer.o src/renwindow.o \ + src/api/api.o src/api/dirmonitor.o \ + src/api/regex.o src/api/renderer.o src/api/system.o \ + src/api/utf8.o src/platform/amigaos4.o \ + src/api/dirmonitor/os4.o outfile := lite @@ -15,14 +17,14 @@ compiler := gcc cxxcompiler := g++ INCPATH := -Isrc -Ilib/dmon -I/sdk/local/newlib/include/SDL2 \ - -I/sdk/local/common/include/lua52 -I/sdk/local/common/include/freetype2 + -I/sdk/local/common/include/lua54 -I/sdk/local/common/include/freetype2 DFLAGS += -D__USE_INLINE__ -DLITE_XL_DATA_USE_EXEDIR CFLAGS += -Werror -Wwrite-strings -O2 -g -std=gnu11 -fno-strict-aliasing LFLAGS += -mcrt=newlib -lauto \ - -lpcre2 -lSDL2 -llua52 -lfreetype -lz -lm -lpthread -athread=native + -lpcre2 -lSDL2 -llua54 -lfreetype -lz -lm -lpthread -athread=native ifeq ($(DEBUG),1) CFLAGS += -gstabs @@ -51,12 +53,11 @@ LiteXL: $(LiteXL_OBJ) .c.o: @echo "Compiling $<" - $(compiler) -c $< -o $*.o $(CFLAGS) $(INCPATH) $(DFLAGS) + @$(compiler) -c $< -o $*.o $(CFLAGS) $(INCPATH) $(DFLAGS) -src/dirmonitor.o: src/dirmonitor.c src/platform/amigaos4.h src/main.o: src/main.c src/api/api.h src/rencache.h \ - src/renderer.h src/platform/amigaos4.h src/dirmonitor.h + src/renderer.h src/platform/amigaos4.h src/rencache.o: src/rencache.c @@ -74,8 +75,11 @@ src/api/system.o: src/api/system.c src/platform/amigaos4.o: src/platform/amigaos4.c +src/api/dirmonitor.o: src/api/dirmonitor.c src/api/dirmonitor/os4.c +src/api/utf8.o: src/api/utf8.c +src/api/dirmonitor/os4.o: src/api/dirmonitor/os4.c release: @echo "Creating release files..." diff --git a/README_Amiga.md b/README_Amiga.md index 0f912597..406a7beb 100644 --- a/README_Amiga.md +++ b/README_Amiga.md @@ -10,23 +10,14 @@ It might crash from time to time, if there is a path problem, but overall it works pretty well. This is my daily editor for any kind of development. If it crashes on your system, try to delete to `.config` folder. -## New features against Lite XL v1 -- Faster file scrolling -- Faster switch between tabs -- Reposition tabs at the side or at the bottom of other tabs, making - multiple columns/rows of opened files -- Multiple cursor editing -- Better font manipulation and appearance -- Faster transitions - -## Installation +## Installation You can extract the Lite XL archive wherever you want and run the *lite* editor. ## Configuration folder This editor creates a `.config` folder where the configuration is saved, as well as plugins, themes etc.. By default this version uses the -executable folder, but if you want to overide it, you can create an ENV +executable folder, but if you want to override it, you can create an ENV variable named `HOME` and set there your prefferable path. You can check if there is one already set by executing the following command @@ -84,7 +75,11 @@ The included plugins are the following: **autoinsert** Automatically inserts closing brackets and quotes. Also allows selected - text to be wrapped with brackets or quotes. +text to be wrapped with brackets or quotes. + +**autosaveonfocuslost** +Automatically saves files that were changed when the main window loses +focus by switching to another application **autowrap** Automatically hardwraps lines when typing @@ -99,19 +94,24 @@ Underlines matching pair for bracket under the caret Underlays color values (eg. `#ff00ff` or `rgb(255, 0, 255)`) with their resultant color. -**eofnewline-xl** -Make sure the file ends with one blank line. - **ephemeral_tabs** Preview tabs. Opening a doc will replace the contents of the preview tab. Marks tabs as non-preview on any change or tab double clicking. **ghmarkdown** -Opens a preview of the current markdown file in a browser window +Opens a preview of the current markdown file in a browser window. +On AmigaOS 4 it uses *urlopen* and on MorphOS it uses *openurl* to load +the generated html in the browser. **indentguide** Adds indent guides +**language_guide** +Syntax for the AmigaGuide scripting language + +**language_hws** +Syntax for the Hollywood language + **language_make** Syntax for the Make build system language @@ -132,6 +132,17 @@ this plugin will make the editor slower on file loading and scrolling. Allows moving back and forward between document positions, reducing the amount of scrolling +**nonicons** +File icons set for TreeView. Download TTF font to your config/fonts +folder from https://github.com/yamatsum/nonicons/tree/master/dist + +**opacity** +Change the opaqueness/transparency of lite-xl using shift+mousewheel +or a command. + +**openfilelocation** +Opens the parent directory of the current file in the file manager + **rainbowparen** Show nesting of parentheses with rainbow colours @@ -139,6 +150,10 @@ Show nesting of parentheses with rainbow colours Keep a list of recently closed tabs, and restore the tab in order on cntrl+shift+t. +**select_colorscheme** +Select a color theme, like VScode, Sublime Text. +(plugin saves changes) + **selectionhighlight** Highlights regions of code that match the current selection @@ -195,6 +210,30 @@ https://git.walkero.gr/walkero/lite-xl/issues # Changelog +## [2.1.0r1] - 2022-10-10 +### Added +- This version of LiteXL recognises changes that are done outside the editor + in files and folders, and updates the items when it gets focus again. + +### Changed +- Synced the code with the latest upstream master branch, which means that + this version is based on the latest available source +- Now the plugins need to be version 3. The older versions will not work. + All the included plugins are updated to the latest available version. +- Compiled with SDL 2.24 +- Compiled with Lua 5.4 + +### Fixed +- Fixed regex issues with some plugins +- Fixed "Open in System" on AmigaOS 4 and MorphOS. When you right click + at a file or a folder at the treeview at the left side, then depending + the type of the item opens on Workbench. A folder opens in a list view + and a file opens with its default tool +- Fixed markdown preview on MorphOS. Now, it calls openurl with the html + file (#20) +- Fixed locale issues on MorphOS (again), since the previous fix didn't + actually fixed the problem + ## [2.0.3r3] - 2022-09-26 ### Added - Added plugin for AmigaGuide files diff --git a/data/core/common.lua b/data/core/common.lua index f02cec55..90393b8f 100644 --- a/data/core/common.lua +++ b/data/core/common.lua @@ -428,7 +428,7 @@ end function common.is_absolute_path(path) - return path:sub(1, 1) == PATHSEP or path:match("^(%a):\\") + return path:sub(1, 1) == PATHSEP or path:match("^(%a):\\") or path:match('^(%w*):') end diff --git a/data/core/start.lua b/data/core/start.lua index e01ac912..a8f65712 100644 --- a/data/core/start.lua +++ b/data/core/start.lua @@ -1,5 +1,5 @@ -- this file is used by lite-xl to setup the Lua environment when starting -VERSION = "2.0.5r1" +VERSION = "2.1.0r1" MOD_VERSION = "3" SCALE = tonumber(os.getenv("LITE_SCALE") or os.getenv("GDK_SCALE") or os.getenv("QT_SCALE_FACTOR")) or SCALE @@ -54,3 +54,4 @@ local appimage_owd = os.getenv("OWD") if os.getenv("APPIMAGE") and appimage_owd then system.chdir(appimage_owd) end + diff --git a/data/plugins/language_md.lua b/data/plugins/language_md.lua index d622a04d..72b77681 100644 --- a/data/plugins/language_md.lua +++ b/data/plugins/language_md.lua @@ -232,3 +232,4 @@ core.add_thread(function() coroutine.yield(1) end end) + diff --git a/data/plugins/treeview.lua b/data/plugins/treeview.lua index 4b95e240..c2281fac 100644 --- a/data/plugins/treeview.lua +++ b/data/plugins/treeview.lua @@ -811,10 +811,12 @@ command.add(function() ["treeview:open-in-system"] = function(item) if PLATFORM == "Windows" then system.exec(string.format("start \"\" %q", item.abs_filename)) - elseif string.find(PLATFORM, "Mac") then + elseif string.find(PLATFORM, "Mac") or PLATFORM == "MorphOS" then system.exec(string.format("open %q", item.abs_filename)) elseif PLATFORM == "Linux" or string.find(PLATFORM, "BSD") then system.exec(string.format("xdg-open %q", item.abs_filename)) + elseif PLATFORM == "AmigaOS 4" then + system.exec(string.format("WBRUN %q SHOW=all VIEWBY=name", item.abs_filename)) end end }) diff --git a/src/api/api.c b/src/api/api.c index acf6eec2..dd8af16e 100644 --- a/src/api/api.c +++ b/src/api/api.c @@ -3,7 +3,7 @@ int luaopen_system(lua_State *L); int luaopen_renderer(lua_State *L); int luaopen_regex(lua_State *L); -int luaopen_process(lua_State *L); +// int luaopen_process(lua_State *L); int luaopen_dirmonitor(lua_State* L); int luaopen_utf8extra(lua_State* L); @@ -11,7 +11,7 @@ static const luaL_Reg libs[] = { { "system", luaopen_system }, { "renderer", luaopen_renderer }, { "regex", luaopen_regex }, - { "process", luaopen_process }, + // { "process", luaopen_process }, { "dirmonitor", luaopen_dirmonitor }, { "utf8extra", luaopen_utf8extra }, { NULL, NULL } diff --git a/src/api/dirmonitor/mos.c b/src/api/dirmonitor/mos.c new file mode 100644 index 00000000..d13a88e7 --- /dev/null +++ b/src/api/dirmonitor/mos.c @@ -0,0 +1,9 @@ +#include + +struct dirmonitor_internal* init_dirmonitor() { return NULL; } +void deinit_dirmonitor(struct dirmonitor_internal* monitor) { } +int get_changes_dirmonitor(struct dirmonitor_internal* monitor, char* buffer, size_t len) { return -1; } +int translate_changes_dirmonitor(struct dirmonitor_internal* monitor, char* buffer, int size, int (*callback)(int, const char*, void*), void* data) { return -1; } +int add_dirmonitor(struct dirmonitor_internal* monitor, const char* path) { return -1; } +void remove_dirmonitor(struct dirmonitor_internal* monitor, int fd) { } + diff --git a/src/api/dirmonitor/os4.c b/src/api/dirmonitor/os4.c new file mode 100644 index 00000000..d13a88e7 --- /dev/null +++ b/src/api/dirmonitor/os4.c @@ -0,0 +1,9 @@ +#include + +struct dirmonitor_internal* init_dirmonitor() { return NULL; } +void deinit_dirmonitor(struct dirmonitor_internal* monitor) { } +int get_changes_dirmonitor(struct dirmonitor_internal* monitor, char* buffer, size_t len) { return -1; } +int translate_changes_dirmonitor(struct dirmonitor_internal* monitor, char* buffer, int size, int (*callback)(int, const char*, void*), void* data) { return -1; } +int add_dirmonitor(struct dirmonitor_internal* monitor, const char* path) { return -1; } +void remove_dirmonitor(struct dirmonitor_internal* monitor, int fd) { } + diff --git a/src/dirmonitor.o b/src/dirmonitor.o deleted file mode 100644 index 42f5e61eea1705991e3e02af3421a506ab5bb42e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3648 zcma)8+iw(A7(Zurb}8LMPKv}FkYgGF+Q01V2mah(L{p}COqKpJD1rh8ucXSoZol< z&UfaVGnZ%Q4|9XFxN$ZFoM5cEBxJkAIK~E9-?1yKpgUBrGlOKNut^vS12Gup8k!B> zB_=~qDbq01g6K8L4cvdKx3+sVLWT?@5fv`~QOuh?L|yKsk%^Iu(O@~^r1;G(m_Fyc&rC1E zJ>S^x+AO`e3EY9@*Jw&!-$$Sc`BF9!XmvlOWd9@SZqeIdIdnVobmyMxxDnz zm*>I;QOKshm!-ON(1~uw24b&DW3a>z_UOb$duVA>-DH|iClWMZI#gmEO~%$G$pW%j zUt;5VX)mj`S)B|?$x(b(it(0^UpD!zTrcBj;G^>}sIju&iprsVw%lsfidMs|TYgw> zI_EvNT6UW?uWdVwu-)*RjM;90*^T_5R3jI)=t9dWEtCI-6)j5?MmA2E#AF79Z;hol zu(UYAsVzLs@7j}2<@5P8&uqlCz$usVD(^E#j~}ZXnqHX0H2v7@p@msS&MN1vsJ2|e z84#J*eA_8|ZsZhKJZAgts^>^Gs}{M)xE(qHJ96wqVS0SLFj3lF+EFMrYC&{BF0oLo z7mCMs6^h9DK)u<9QgNy2gACkSRJ1(T3f*R%RVqt1s?eyc_${Z&mOS5znCCa^1u?Xn zp<8b{c7bk|n5ZpVL84+6+i_7krZW4xVYuuEQ6V-bUvXU5aU8bfdQJ;vPOh*LF=@9- zz2%4Q3QLyo=<$=Y9e3e56!4BnVlOMLC}1M-xXy77=bRvl>w5$R~(%&zjsm|n&{vou#7BJcDKu0r& zu@s#)n}u7JJ|T{o@w0vLo<%e)ORr76rhr{@wFu=h_451~_j^cSJ?qaO~v zw}6=+F}#MZn~p`Zp_zDhY0rK`Cwp2q`6J)7_JqIee$Wr2>!$r_TF)`xWVe6UOq$^= zmMJ=shma@Y37T?=8-)5S2p(wh!=)8KQ_gV%jTgGpK#RXF%>hm8#gB|==Ag`vejh2W zrfDDP+(^1};o{Zp5V$z-oFr)Vz$7^G5|8g^cogf2|Mrl}TB^?z=-3N^NoSqHJAv=U z*6AAJM^<23!!T0R{4uG|L-29VgrCoV_b5J=%??Uz&^iw*{ujUt3hx7cTw*o@Tvhsr z&s@cSAGoFXRM+#0Pka8f#Qa6zmleJR{JO$dfIm?9Bj8UYX72(c56YQCmwl@+{oa4C zFkPe9mHwN+zbZZ+7WRk2u;ZJQ&Q{=2#V-Qm9u+k~jrpX+bZ_w~g-J)(1ohxYl|Jqr zenw*c4lrsW>W^=OFLm~U2TJEv@Sjn(KLfuau`vSthSH(j;EVDx5TAdj^iKhQs_-|! zUn%_?z~8A@4EP6yX&-Sm((of1&Tsskp#Cu)!g<#^xHDru@`(BPegvO diff --git a/src/main.c b/src/main.c index 405b9dd8..7d014d3a 100644 --- a/src/main.c +++ b/src/main.c @@ -6,7 +6,7 @@ #include "renderer.h" #if defined(__amigaos4__) || defined(__morphos__) -#define VSTRING "Lite XL 2.0.3r3 (26.09.2022)" +#define VSTRING "Lite XL 2.1.0r1 (10.10.2022)" #define VERSTAG "\0$VER: " VSTRING #endif @@ -104,6 +104,8 @@ void set_macos_bundle_resources(lua_State *L); #define ARCH_PROCESSOR "aarch64" #elif __arm__ #define ARCH_PROCESSOR "arm" + #elif __amigaos4__ || __morphos__ + #define ARCH_PROCESSOR "ppc" #else #define ARCH_PROCESSOR "x86" #endif @@ -113,6 +115,10 @@ void set_macos_bundle_resources(lua_State *L); #define ARCH_PLATFORM "linux" #elif __APPLE__ #define ARCH_PLATFORM "darwin" + #elif __amigaos4__ + #define ARCH_PLATFORM "amigaos4" + #elif __morphos__ + #define ARCH_PLATFORM "morphos" #else #error "Please define -DLITE_ARCH_TUPLE." #endif @@ -125,7 +131,7 @@ int main(int argc, char **argv) { int (*SetProcessDPIAware)() = (void*) GetProcAddress(lib, "SetProcessDPIAware"); SetProcessDPIAware(); #elif defined(__morphos__) - setlocale(LC_ALL, ""); + setlocale(LC_ALL, "C"); #else signal(SIGPIPE, SIG_IGN); #endif