Updates to make latest code compile and work under OS4

This commit is contained in:
George Sokianos 2023-01-09 00:45:37 +00:00
parent 65d95c7f40
commit 62adafb59d
6 changed files with 73 additions and 63 deletions

View File

@ -1,7 +1,7 @@
# #
# Project: Lite XL # Project: Lite XL
# #
# Created on: 26-12-2021 # Created on: 26-12-2021
# #
LiteXL_OBJ := \ LiteXL_OBJ := \
@ -11,23 +11,22 @@ LiteXL_OBJ := \
src/api/utf8.o src/platform/amigaos4.o \ src/api/utf8.o src/platform/amigaos4.o \
src/api/dirmonitor/os4.o src/api/dirmonitor/os4.o
outfile := lite outfile := lite
compiler := gcc compiler := gcc-11
cxxcompiler := g++ cxxcompiler := g++-11
INCPATH := -Isrc -Ilib/dmon -I/sdk/local/newlib/include/SDL2 \ INCPATH := -Isrc -I/sdk/local/newlib/include/SDL2 \
-I/sdk/local/common/include/lua54 -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 DFLAGS += -D__USE_INLINE__ -DLITE_XL_DATA_USE_EXEDIR
CFLAGS += -Werror -Wwrite-strings -O3 -std=gnu11 -fno-strict-aliasing
LFLAGS += -mcrt=newlib -lauto \ LFLAGS += -mcrt=newlib -lauto \
-lpcre2 -lSDL2 -llua54 -lfreetype -lz -lm -lpthread -athread=native -lpcre2 -lSDL2 -llua54 -lfreetype -lz -lm -lpthread -athread=native
ifeq ($(DEBUG),1) ifeq ($(DEBUG),1)
CFLAGS += -gstabs CFLAGS += -g -gstabs
LFLAGS += -gstabs LFLAGS += -gstabs
ifeq ($(PROFYLER),1) ifeq ($(PROFYLER),1)
@ -48,7 +47,7 @@ clean:
LiteXL: $(LiteXL_OBJ) LiteXL: $(LiteXL_OBJ)
@echo "Linking LiteXL" @echo "Linking LiteXL"
@$(compiler) -o $(outfile) $(LiteXL_OBJ) $(LFLAGS) @$(compiler) -o $(outfile) $(LiteXL_OBJ) $(LFLAGS)
.c.o: .c.o:
@ -81,7 +80,7 @@ src/api/utf8.o: src/api/utf8.c
src/api/dirmonitor/os4.o: src/api/dirmonitor/os4.c src/api/dirmonitor/os4.o: src/api/dirmonitor/os4.c
release: release:
@echo "Creating release files..." @echo "Creating release files..."
@mkdir -p release/LiteXL2 @mkdir -p release/LiteXL2
@cp -r release_files/* release/LiteXL2/ @cp -r release_files/* release/LiteXL2/
@ -97,4 +96,3 @@ release:
@lha -aeqr3 a LiteXL2_OS4.lha release/ @lha -aeqr3 a LiteXL2_OS4.lha release/
@echo "Clean release files..." @echo "Clean release files..."
@delete release ALL QUIET FORCE @delete release ALL QUIET FORCE

View File

@ -1,24 +1,21 @@
# Lite XL v2 for AmigaOS 4.1 FE & MorphOS 3 # Lite XL v2 for AmigaOS 4.1 FE & MorphOS 3
Lite XL is a lightweight text editor written in Lua. Lite XL is a lightweight text editor written in Lua and SDL2.
The port is not perfect and it might have issues here and there. For example The port is not perfect and it might have issues here and there. It might
the filesystem notifications are not working yet. So when you make changes crash from time to time, if there is a path problem, but overall it works
at a project folder those will not be reflected in Lite XL automatically. pretty well. This is my daily editor for any kind of development.
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. If it crashes on your system, try to delete to `.config` folder.
## Installation ## Installation
You can extract the Lite XL archive wherever you want and run the *lite* You can extract the Lite XL archive wherever you want and run the *lite*
editor. editor.
## Configuration folder ## Configuration folder
This editor creates a `.config` folder where the configuration is saved, as This editor creates a `.config` folder where the configuration is saved, as
well as plugins, themes etc.. By default this version uses the well as plugins, themes etc.. By default this version uses the installation
executable folder, but if you want to override it, you can create an ENV folder, but if you want to override it, you can create an ENV variable
variable named `HOME` and set there your prefferable path. named `HOME` and set there your prefferable path.
You can check if there is one already set by executing the following command You can check if there is one already set by executing the following command
in a shell in a shell
@ -27,7 +24,7 @@ GetEnv HOME
``` ```
If there is one set, then you will see the path at the output. If there is one set, then you will see the path at the output.
Otherwise, you can set your home path be executing the following command. Otherwise, you can set your home path be executing the following command.
Change the path to the one of your preference. Change the path to the one of your preference.
``` ```
SetEnv SAVE HOME "Sys:home/" SetEnv SAVE HOME "Sys:home/"
@ -36,7 +33,7 @@ SetEnv SAVE HOME "Sys:home/"
## Addons ## Addons
### Colors ### Colors
Colors are lua files that set the color scheme of the editor. There are Colors are lua files that set the color scheme of the editor. There are
light and dark themes for you to choose. light and dark themes for you to choose.
To install and use them you have to copy the ones you would like from To install and use them you have to copy the ones you would like from
`addons/colors/light` or `addons/colors/dark` into the folder `addons/colors/light` or `addons/colors/dark` into the folder
@ -48,19 +45,19 @@ at the cog icon at the toolbar (bottom left sixth icon). Go at the line
that looks like below that looks like below
``` ```
-- core.reload_module("colors.summer") -- core.reload_module("colors.summer")
``` ```
and change the `summer` with the name of your color theme. Also, remove and change the `summer` with the name of your color theme. Also, remove
the two dashes `--` at the start of the line and save the file. If you the two dashes `--` at the start of the line and save the file. If you
did everything right, the color schema should change instantly. did everything right, the color schema should change instantly.
The themes can also be found at The themes can also be found at
https://github.com/lite-xl/lite-xl-colors https://github.com/lite-xl/lite-xl-colors
### Plugins ### Plugins
This Lite XL release is based on version 2.0.3 of the application as LiteXL is able to use plugins to extend its features. Those can be found
released on other systems, by the original development team. at https://github.com/lite-xl/lite-xl-plugins and other websites. Not all
This not the latest version. This means that some of the latest of them will work fine on AmigaOS 4 or MorphOS, because of missing
plugins might not working at all or need modifications to work. dependencies or filesystem issues.
To make it easier for you, I gathered some of the plugins that are working To make it easier for you, I gathered some of the plugins that are working
well, and I included them under `addons/plugins`. For you to install the well, and I included them under `addons/plugins`. For you to install the
@ -74,10 +71,10 @@ need.
The included plugins are the following: The included plugins are the following:
**autoinsert** **autoinsert**
Automatically inserts closing brackets and quotes. Also allows selected 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** **autosaveonfocuslost**
Automatically saves files that were changed when the main window loses Automatically saves files that were changed when the main window loses
focus by switching to another application focus by switching to another application
@ -91,9 +88,18 @@ Shows the current time and date in a view with large text
Underlines matching pair for bracket under the caret Underlines matching pair for bracket under the caret
**colorpreview** **colorpreview**
Underlays color values (eg. `#ff00ff` or `rgb(255, 0, 255)`) with their Underlays color values (eg. `#ff00ff` or `rgb(255, 0, 255)`) with their
resultant color. resultant color.
**custom_caret**
Customize the caret in the editor setting it to *underline*, *block* or
*line* at the init.lua file in your config folder.
For example add:
`config.plugins.custom_caret.shape = "block"`
**EditorConfig**
EditorConfig (https://editorconfig.org/) implementation for Lite XL
**ephemeral_tabs** **ephemeral_tabs**
Preview tabs. Opening a doc will replace the contents of the preview tab. 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. Marks tabs as non-preview on any change or tab double clicking.
@ -125,19 +131,19 @@ Automatically inserts indentation and closing bracket/text after newline
Add markers to docs and jump between them quickly Add markers to docs and jump between them quickly
**minimap** **minimap**
Shows a minimap on the right-hand side of the docview. Please note that Shows a minimap on the right-hand side of the docview. Please note that
this plugin will make the editor slower on file loading and scrolling. this plugin will make the editor slower on file loading and scrolling.
**navigate** **navigate**
Allows moving back and forward between document positions, reducing the Allows moving back and forward between document positions, reducing the
amount of scrolling amount of scrolling
**nonicons** **nonicons**
File icons set for TreeView. Download TTF font to your config/fonts File icons set for TreeView. Download TTF font to your config/fonts
folder from https://github.com/yamatsum/nonicons/tree/master/dist folder from https://github.com/yamatsum/nonicons/tree/master/dist
**opacity** **opacity**
Change the opaqueness/transparency of lite-xl using shift+mousewheel Change the opaqueness/transparency of lite-xl using LAmiga+mousewheel
or a command. or a command.
**openfilelocation** **openfilelocation**
@ -147,7 +153,7 @@ Opens the parent directory of the current file in the file manager
Show nesting of parentheses with rainbow colours Show nesting of parentheses with rainbow colours
**restoretabs** **restoretabs**
Keep a list of recently closed tabs, and restore the tab in order on Keep a list of recently closed tabs, and restore the tab in order on
cntrl+shift+t. cntrl+shift+t.
**select_colorscheme** **select_colorscheme**
@ -161,13 +167,12 @@ Highlights regions of code that match the current selection
It adds a small clock at the bottom right corner. It adds a small clock at the bottom right corner.
## Tips and tricks ## Tips and tricks
### Transitions ### Transitions
If you want to disable the transitions and make the editor faster, If you want to disable the transitions and make the editor faster,
open your configuration file by clicking at the cog icon at the toolbar open your configuration file by clicking at the cog icon at the toolbar
(bottom left, 6th icon) and add the following line at the end of the file, (bottom left, 6th icon) and add the following line at the end of the file,
and then save it. You might need to restart your editor (CTRL+SHIFT+R) and then save it. You might need to restart your editor.
``` ```
config.transitions = false config.transitions = false
@ -176,16 +181,16 @@ config.transitions = false
### Hide files from the file list ### Hide files from the file list
If you would like to hide files or whole folder from the left side bar list, If you would like to hide files or whole folder from the left side bar list,
open your configuration by clicking at the cog icon at the toolbar open your configuration by clicking at the cog icon at the toolbar
(bottom left sixth icon) and add the followline at the end of the file and (bottom left sixth icon) and add the followline at the end of the file and
save it. This hides all the files that start with a dot, and all the `.info` save it. This hides all the files that start with a dot, and all the `.info`
files. You might need to restart your editor (CTRL+SHIFT+R) files. You might need to restart your editor.
``` ```
config.ignore_files = {"^%.", "%.info$"} config.ignore_files = {"^%.", "%.info$"}
``` ```
You can add as many rules as you want in there, to hide files or You can add as many rules as you want in there, to hide files or
folders, as you like. folders, as you like.
## I would like to thank ## I would like to thank
@ -205,11 +210,23 @@ please consider to buy me a coffee at:
https://ko-fi.com/walkero https://ko-fi.com/walkero
## Known issues ## Known issues
You can find the known issues at You can find the known issues at
https://git.walkero.gr/walkero/lite-xl/issues https://git.walkero.gr/walkero/lite-xl/issues
# Changelog # Changelog
## [2.1.1r1] - 2022-01-08
### Changed
- Synced the code with the latest upstream master branch, which means that
this version is based on the latest available source
- Compiled with SDL 2.26
- Updated the colour themes and the plugins that are included in the release
- Compiled with gcc 11 on AmigaOS 4
### Fixed
- Set the default locale on AmigaOS 4, so as to fix some issues with decimal
numbers
## [2.1.0r1] - 2022-10-10 ## [2.1.0r1] - 2022-10-10
### Added ### Added
- This version of LiteXL recognises changes that are done outside the editor - This version of LiteXL recognises changes that are done outside the editor
@ -225,9 +242,9 @@ https://git.walkero.gr/walkero/lite-xl/issues
### Fixed ### Fixed
- Fixed regex issues with some plugins - Fixed regex issues with some plugins
- Fixed "Open in System" on AmigaOS 4 and MorphOS. When you right click - 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 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 the type of the item opens on Workbench. A folder opens in a list view
and a file opens with its default tool and a file opens with its default tool
- Fixed markdown preview on MorphOS. Now, it calls openurl with the html - Fixed markdown preview on MorphOS. Now, it calls openurl with the html
file (#20) file (#20)
@ -241,7 +258,7 @@ https://git.walkero.gr/walkero/lite-xl/issues
### Fixed ### Fixed
- Fixed non existing path crashes on OS4 and MorphOS - Fixed non existing path crashes on OS4 and MorphOS
- Fixed editor refresh whenever init.lua is changed, no matter the working - Fixed editor refresh whenever init.lua is changed, no matter the working
folder folder
- Fixed an issue when the user added a directory in the project that - Fixed an issue when the user added a directory in the project that
already existed already existed
@ -250,7 +267,7 @@ https://git.walkero.gr/walkero/lite-xl/issues
- Fixed "Find" on MorphOS that was not working (shortcut CTRL+F) - Fixed "Find" on MorphOS that was not working (shortcut CTRL+F)
- If the user selects to change the project folder and inserts Sys: or any - If the user selects to change the project folder and inserts Sys: or any
partition name, the included folders will be listed as suggestions partition name, the included folders will be listed as suggestions
### Changed ### Changed
- Removed linking with unix on OS4 build - Removed linking with unix on OS4 build
- Makefiles updated - Makefiles updated
@ -277,4 +294,3 @@ https://git.walkero.gr/walkero/lite-xl/issues
YOU MAY USE IT AT YOUR OWN RISK! YOU MAY USE IT AT YOUR OWN RISK!
I will not be held responsible for any data loss or problems you might get I will not be held responsible for any data loss or problems you might get
by using this software. by using this software.

View File

@ -1,5 +1,5 @@
-- this file is used by lite-xl to setup the Lua environment when starting -- this file is used by lite-xl to setup the Lua environment when starting
VERSION = "2.1.0r1" VERSION = "2.1.1r1"
MOD_VERSION = "3" MOD_VERSION = "3"
SCALE = tonumber(os.getenv("LITE_SCALE") or os.getenv("GDK_SCALE") or os.getenv("QT_SCALE_FACTOR")) or SCALE SCALE = tonumber(os.getenv("LITE_SCALE") or os.getenv("GDK_SCALE") or os.getenv("QT_SCALE_FACTOR")) or SCALE

View File

@ -6,4 +6,5 @@ int get_changes_dirmonitor(struct dirmonitor_internal* monitor, char* buffer, si
int translate_changes_dirmonitor(struct dirmonitor_internal* monitor, char* buffer, int size, int (*callback)(int, const char*, void*), void* data) { 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; } int add_dirmonitor(struct dirmonitor_internal* monitor, const char* path) { return -1; }
void remove_dirmonitor(struct dirmonitor_internal* monitor, int fd) { } void remove_dirmonitor(struct dirmonitor_internal* monitor, int fd) { }
int get_mode_dirmonitor() { return 1; }

View File

@ -1,16 +1,11 @@
#include <string.h> #include <string.h>
#include "api.h" #include "api.h"
<<<<<<< HEAD
#include "renderer.h" #include "renderer.h"
#include "rencache.h" #include "rencache.h"
=======
#include "../renderer.h"
#include "../rencache.h"
#include "lua.h" #include "lua.h"
// a reference index to a table that stores the fonts // a reference index to a table that stores the fonts
static int RENDERER_FONT_REF = LUA_NOREF; static int RENDERER_FONT_REF = LUA_NOREF;
>>>>>>> master
static int font_get_options( static int font_get_options(
lua_State *L, lua_State *L,

View File

@ -8,7 +8,7 @@
#include <signal.h> #include <signal.h>
#if defined(__amigaos4__) || defined(__morphos__) #if defined(__amigaos4__) || defined(__morphos__)
#define VSTRING "Lite XL 2.1.0r1 (10.10.2022)" #define VSTRING "Lite XL 2.1.1r1 (08.01.2023)"
#define VERSTAG "\0$VER: " VSTRING #define VERSTAG "\0$VER: " VSTRING
#endif #endif
@ -19,6 +19,7 @@
#elif defined(__APPLE__) #elif defined(__APPLE__)
#include <mach-o/dyld.h> #include <mach-o/dyld.h>
#elif defined(__amigaos4__) #elif defined(__amigaos4__)
#include <locale.h>
#include "platform/amigaos4.h" #include "platform/amigaos4.h"
static CONST_STRPTR stack USED = "$STACK:102400"; static CONST_STRPTR stack USED = "$STACK:102400";
static CONST_STRPTR version USED = VERSTAG; static CONST_STRPTR version USED = VERSTAG;
@ -294,4 +295,3 @@ init_lua:
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }