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
#
# Created on: 26-12-2021
# Created on: 26-12-2021
#
LiteXL_OBJ := \
@ -11,23 +11,22 @@ LiteXL_OBJ := \
src/api/utf8.o src/platform/amigaos4.o \
src/api/dirmonitor/os4.o
outfile := lite
compiler := gcc
cxxcompiler := g++
compiler := gcc-11
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
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 \
-lpcre2 -lSDL2 -llua54 -lfreetype -lz -lm -lpthread -athread=native
-lpcre2 -lSDL2 -llua54 -lfreetype -lz -lm -lpthread -athread=native
ifeq ($(DEBUG),1)
CFLAGS += -gstabs
CFLAGS += -g -gstabs
LFLAGS += -gstabs
ifeq ($(PROFYLER),1)
@ -48,7 +47,7 @@ clean:
LiteXL: $(LiteXL_OBJ)
@echo "Linking LiteXL"
@$(compiler) -o $(outfile) $(LiteXL_OBJ) $(LFLAGS)
@$(compiler) -o $(outfile) $(LiteXL_OBJ) $(LFLAGS)
.c.o:
@ -81,7 +80,7 @@ src/api/utf8.o: src/api/utf8.c
src/api/dirmonitor/os4.o: src/api/dirmonitor/os4.c
release:
release:
@echo "Creating release files..."
@mkdir -p release/LiteXL2
@cp -r release_files/* release/LiteXL2/
@ -97,4 +96,3 @@ release:
@lha -aeqr3 a LiteXL2_OS4.lha release/
@echo "Clean release files..."
@delete release ALL QUIET FORCE

View File

@ -1,24 +1,21 @@
# 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 filesystem notifications are not working yet. So when you make changes
at a project folder those will not be reflected in Lite XL automatically.
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.
The port is not perfect and it might have issues here and there. 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.
## Installation
You can extract the Lite XL archive wherever you want and run the *lite*
## 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 override it, you can create an ENV
variable named `HOME` and set there your prefferable path.
This editor creates a `.config` folder where the configuration is saved, as
well as plugins, themes etc.. By default this version uses the installation
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
in a shell
@ -27,7 +24,7 @@ GetEnv HOME
```
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.
```
SetEnv SAVE HOME "Sys:home/"
@ -36,7 +33,7 @@ SetEnv SAVE HOME "Sys:home/"
## Addons
### Colors
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
`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
```
-- core.reload_module("colors.summer")
```
```
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
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
### Plugins
This Lite XL release is based on version 2.0.3 of the application as
released on other systems, by the original development team.
This not the latest version. This means that some of the latest
plugins might not working at all or need modifications to work.
LiteXL is able to use plugins to extend its features. Those can be found
at https://github.com/lite-xl/lite-xl-plugins and other websites. Not all
of them will work fine on AmigaOS 4 or MorphOS, because of missing
dependencies or filesystem issues.
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
@ -74,10 +71,10 @@ need.
The included plugins are the following:
**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.
**autosaveonfocuslost**
**autosaveonfocuslost**
Automatically saves files that were changed when the main window loses
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
**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.
**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**
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.
@ -125,19 +131,19 @@ Automatically inserts indentation and closing bracket/text after newline
Add markers to docs and jump between them quickly
**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.
**navigate**
Allows moving back and forward between document positions, reducing the
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
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
Change the opaqueness/transparency of lite-xl using LAmiga+mousewheel
or a command.
**openfilelocation**
@ -147,7 +153,7 @@ Opens the parent directory of the current file in the file manager
Show nesting of parentheses with rainbow colours
**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.
**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.
## Tips and tricks
### Transitions
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,
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
@ -176,16 +181,16 @@ config.transitions = false
### Hide files from the file 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
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$"}
```
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.
## I would like to thank
@ -205,11 +210,23 @@ please consider to buy me a coffee at:
https://ko-fi.com/walkero
## Known issues
You can find the known issues at
You can find the known issues at
https://git.walkero.gr/walkero/lite-xl/issues
# 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
### Added
- 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 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
- 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)
@ -241,7 +258,7 @@ https://git.walkero.gr/walkero/lite-xl/issues
### Fixed
- 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
- Fixed an issue when the user added a directory in the project that
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)
- If the user selects to change the project folder and inserts Sys: or any
partition name, the included folders will be listed as suggestions
### Changed
- Removed linking with unix on OS4 build
- Makefiles updated
@ -277,4 +294,3 @@ https://git.walkero.gr/walkero/lite-xl/issues
YOU MAY USE IT AT YOUR OWN RISK!
I will not be held responsible for any data loss or problems you might get
by using this software.

View File

@ -1,5 +1,5 @@
-- 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"
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 add_dirmonitor(struct dirmonitor_internal* monitor, const char* path) { return -1; }
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 "api.h"
<<<<<<< HEAD
#include "renderer.h"
#include "rencache.h"
=======
#include "../renderer.h"
#include "../rencache.h"
#include "lua.h"
// a reference index to a table that stores the fonts
static int RENDERER_FONT_REF = LUA_NOREF;
>>>>>>> master
static int font_get_options(
lua_State *L,

View File

@ -8,7 +8,7 @@
#include <signal.h>
#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
#endif
@ -19,6 +19,7 @@
#elif defined(__APPLE__)
#include <mach-o/dyld.h>
#elif defined(__amigaos4__)
#include <locale.h>
#include "platform/amigaos4.h"
static CONST_STRPTR stack USED = "$STACK:102400";
static CONST_STRPTR version USED = VERSTAG;
@ -294,4 +295,3 @@ init_lua:
return EXIT_SUCCESS;
}