diff --git a/.gitignore b/.gitignore index 41183a14..4d202f57 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,7 @@ compile_commands.json error.txt lite-xl* LiteXL* +lite +.config/ +*.lha + diff --git a/Makefile.os4 b/Makefile.os4 new file mode 100644 index 00000000..2a7295d7 --- /dev/null +++ b/Makefile.os4 @@ -0,0 +1,25 @@ +# +# Project: Lite XL +# +# Created on: 26-12-2021 +# +.PHONY: build release + +default: build + +build: + @sh os4build.sh + +release: + mkdir -p release/LiteXL + cp release_files/* release/LiteXL/ -r + mv release/LiteXL/LiteXL.info release/ + cp data release/LiteXL/ -r + cp doc release/LiteXL/ -r + cp lite release/LiteXL/ + strip release/LiteXL/lite + cp README.md release/LiteXL/ + cp README_OS4.md release/LiteXL/ + cp LICENSE release/LiteXL/ + lha -aeqr3 a LiteXL.lha release/ + diff --git a/README_OS4.md b/README_OS4.md new file mode 100644 index 00000000..b974ad05 --- /dev/null +++ b/README_OS4.md @@ -0,0 +1,231 @@ +# Lite XL for AmigaOS 4.1 FE + +Lite XL is a lightweight text editor written in Lua. + +## 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 AmigaOS 4.1 FE version uses the +executable folder, but if you want to ovveride it, create an ENV variable +named `HOME` and set there your path. + +You can check if there is one already set by executing the following command +in a shell +``` +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. +Change the path to the one of your preference. +``` +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. + +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 +`.config/lite-xl/colors/`. Don't add light or dark folders. Just copy the +.lua files in there. + +Then you have to start Lite XL and open your configuration by clicking +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 +https://github.com/lite-xl/lite-xl-colors + +### Plugins +The Lite XL that you are using on AmigaOS 4 is based on version 1.16.12 +and not the latest version that is available by the development team. +This means that the latest plugins are not working at all or need some +modifications to work. + +To make it easier for you, I gathered some of the plugins that are working +well, and I included them at the `addons/plugins`. For you to install the +ones you would like to use, you have to copy the `.lua` files into the +folder `.config/lite-xl/plugins/` and restart the editor. + +The included plugins are the following: + +**autoinsert** +Automatically inserts closing brackets and quotes. Also allows selected + text to be wrapped with brackets or quotes. + +**autowrap** +Automatically hardwraps lines when typing + +**bigclock** +Shows the current time and date in a view with large text + +**bracketmatch** +Underlines matching pair for bracket under the caret + +**colorpreview** +Underlays color values (eg. `#ff00ff` or `rgb(255, 0, 255)`) with their +resultant color. + +**eofnewline** +Make sure the file ends with one blank line. + +**ephemeraldocviews** +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 + +**hidelinenumbers** +Hides the line numbers on the left of documents + +**indentguide** +Adds indent guides + +**language_make** +Syntax for the Make build system language + +**language_sh** +Syntax for shell scripting language + +**lfautoinsert** +Automatically inserts indentation and closing bracket/text after newline + +**markers** +Add markers to docs and jump between them quickly + +**memoryusage** +Show memory usage in the status view + +**minimap** +Shows a minimap on the right-hand side of the docview. + +**motiontrail** +Adds a motion-trail to the caret + +**navigate** +Allows moving back and forward between document positions, reducing the +amount of scrolling + +**rainbowparen** +Show nesting of parentheses with rainbow colours + +**restoretabs** +Keep a list of recently closed tabs, and restore the tab in order on +cntrl+shift+t. + +**selectionhighlight** +Highlights regions of code that match the current selection + +**todotreeview** +Todo tree viewer for annotations in code like `TODO`, `BUG`, `FIX`, +`IMPROVEMENT` + +## Tips and tricks + +### Transitions + +If you want to disable the transitions and make the scrolling a little faster, +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. + +``` +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 +(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. + +``` +config.ignore_files = {"^%.", "%.info$"} +``` + +You can add as many rules as you want in there, to hide fore files or +folders, as you like. + + +## Know issues +You can find the known issues at +https://git.walkero.gr/walkero/lite-xl/issues + + +# Changelog + +## [1.16.12.7] - 2022-01-11 +## Added +- Added config.scroll_past_end that when its true lets the user scroll + further than the end of the file. By default is set to true. +- Added "SDL_RENDERER_ACCELERATED" and "SDL_RENDERER_PRESENTVSYNC" on + SDL_CreateRenderer() since this reduces the CPU usage when the user + scrolls and seems to work pretty good on my systems (X5000, A1222 and + microAmigaOne). This is exeprimental. If this brings problems on your + system, you can disable them using SDL ENV variable, like below: + setenv SDL_RENDER_VSYNC 0 + setenv SDL_RENDER_DRIVER "software" +- Added plugins and color schemas in addons folder and information at + the README_OS4 file (#10) + +## Changed +- Compiled Lite XL with gcc 8.4.0 + +## [1.16.12.6] - 2022-01-04 +### Fixed +- Fixed a problem introduced in previous version when LiteXL was executed + from the root path of a partition or from ram disk (#13) + +## [1.16.12.5] - 2022-01-03 +### Changed +- Changed the Gfx memory leak solution to a fix that was applied by the + editor development team on Lua scripts at a later version. Less custom + code for AmigaOS 4 port. +- Now, when return from fullscreen, there is no extra header visible + at the top of the window content + +### Fixed +- Fixed the assertion error and crash when the window is resized (#2) +- Fixed the resolution on fullscreen toggle to be like the workbench (#4) +- Fixed loading the current folder from terminal using the dot, like + `lite .` or without it (#3) + +## [1.16.12.4] - 2021-12-31 +### Fixed +- Fixed the Gfx memory leak. Now LiteXL frees the reserved memory from the + gfx card. + +## [1.16.12.3] - 2021-12-29 +### Changed +- Compiled with an experimental version of the latest Anti-Grain Geometry + library. This is might have issues and crash LiteXL + +## [1.16.12.2] - 2021-12-26 +### Added +- Added Amiga version. This version of LiteXL is based on v1.16.12 source code + which will not change. I will use the fourth digit to distinguish different + AmigaOS 4 releases, until a new port of the latest available source (v2.x) + is made. + +### Fixed +- The keyboard shortcuts are now working + +### Changed +- Now the `HOME` ENV variable is optional. If this is not set, the LiteXL + folder will be used to create user's `.config` folder + diff --git a/README_OS4.md.info b/README_OS4.md.info new file mode 100644 index 00000000..cfd4ecb5 Binary files /dev/null and b/README_OS4.md.info differ diff --git a/os4build.sh b/os4build.sh new file mode 100644 index 00000000..eae70a0d --- /dev/null +++ b/os4build.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +outfile="lite" +compiler="gcc" +cxxcompiler="g++" + +INCPATH="-Isrc -Ilib/dmon -I/sdk/local/newlib/include/SDL2 -I/sdk/local/common/include/freetype2" +DFLAGS="-D__USE_INLINE__ -DLITE_XL_DATA_USE_EXEDIR -DLITE_USE_SDL_RENDERER" +CFLAGS="-Wall -O3 -g -std=gnu11 -fno-strict-aliasing" +LFLAGS="-mcrt=newlib -static-libgcc -static-libstdc++ -lauto -lpcre2 -lSDL2 -llua -lagg -lfreetype -lm -lunix -lpthread -athread=native" + +echo "compiling lite..." + +# $compiler -c src/dirmonitor.c -o dirmonitor.o $CFLAGS $INCPATH $DFLAGS +$compiler -c src/main.c -o main.o $CFLAGS $INCPATH $DFLAGS +$compiler -c src/rencache.c -o rencache.o $CFLAGS $INCPATH $DFLAGS +$compiler -c src/renderer.c -o renderer.o $CFLAGS $INCPATH $DFLAGS +$compiler -c src/renwindow.c -o renwindow.o $CFLAGS $INCPATH $DFLAGS + +$compiler -c src/api/api.c -o api.o $CFLAGS $INCPATH $DFLAGS +# $compiler -c src/api/process.c -o process.o $CFLAGS $INCPATH $DFLAGS +$compiler -c src/api/regex.c -o regex.o $CFLAGS $INCPATH $DFLAGS +$compiler -c src/api/renderer.c -o apirenderer.o $CFLAGS $INCPATH $DFLAGS +$compiler -c src/api/system.c -o system.o $CFLAGS $INCPATH $DFLAGS + +$compiler -c src/platform/amigaos4.c -o amigaos4.o $CFLAGS $INCPATH $DFLAGS + +echo "linking..." +$cxxcompiler -o $outfile *.o $LFLAGS + +echo "cleaning up..." +rm *.o +echo "done" +