From 68d436202ff5b283b10f4b905a574954452538d1 Mon Sep 17 00:00:00 2001 From: Alessandro Mauri Date: Fri, 26 Nov 2021 15:18:01 +0100 Subject: [PATCH 1/7] fix: not being abled to compile in alpine as it is explained here[0] I put CFLAGS and LDFLAGS in the wrong order causing a failure to link [0]: https://stackoverflow.com/questions/58775599/what-could-be-causing-linking-errors-when-compiling-in-an-alpine-docker --- .gitattributes | 3 --- .github/FUNDING.yml | 3 --- makefile | 14 +++++++------- 3 files changed, 7 insertions(+), 13 deletions(-) delete mode 100644 .gitattributes delete mode 100644 .github/FUNDING.yml diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index bd2cfac..0000000 --- a/.gitattributes +++ /dev/null @@ -1,3 +0,0 @@ -winlib/* linguist-vendored -src/lib/* linguist-vendored -icon.inl linguist-vendored diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 375655a..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,3 +0,0 @@ -# These are supported funding model platforms - -github: rxi diff --git a/makefile b/makefile index 327c0cb..086adf2 100644 --- a/makefile +++ b/makefile @@ -1,21 +1,21 @@ -.POSIX: - PREFIX = /usr/local MANPREFIX = ${PREFIX}/share/man -#CC ?= gcc +CC ?= gcc SRCDIR = ./src -CFLAGS = -Wall -Werror -pedantic -O3 -std=c11 -fno-strict-aliasing \ +CFLAGS = -Wall -Werror -pedantic -O2 -std=c11 -fno-strict-aliasing \ -I${SRCDIR} -I${PREFIX}/include/ -DLUA_USE_POSIX -D_PREFIX="${PREFIX}" + #-I/usr/include/SDL2 -I/usr/include/directfb -D_REENTRANT \ + #-I/usr/include/lua5.2 # remove this -LDFLAGS = -L${PREFIX}/lib -lSDL2 -lm -llua5.2 +LDFLAGS = -L${PREFIX}/lib -L/usr/lib/lua5.2 -lpthread -lm -lSDL2 -llua FILES != find ${SRCDIR} -name '*.c' OBJS = ${FILES:.c=.o} .c.o: - ${CC} -c ${CFLAGS} $< -o $@ + ${CC} -c $< -o $@ ${CFLAGS} lite: ${OBJS} - ${CC} ${LDFLAGS} -o $@ ${OBJS} + ${CC} -o $@ ${OBJS} ${LDFLAGS} install: lite mkdir -p ${DESTDIR}${PREFIX}/share/lite From db269b6f2a00673d5581f431f95563cb5e6f081e Mon Sep 17 00:00:00 2001 From: Alessandro Mauri Date: Sat, 27 Nov 2021 00:55:02 +0100 Subject: [PATCH 2/7] updated TODO --- TODO | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/TODO b/TODO index 2f22006..49e8cc1 100644 --- a/TODO +++ b/TODO @@ -7,10 +7,12 @@ [x] makefile: add install and uninstall [ ] makefile fix permissions of installed data dir [ ] SDL: disable key not recognized messages -[ ] font: use system fonts +[U] font: use system fonts [ ] font: implement hashmap of already rendered glyphs and only re-draw the ones that are not in that map [ ] font: resize text on the fly +[ ] font: change font on the fly from a list of installed fonts + [ ] implement a user directory for fonts (like plugins) [ ] ui: change ui scale on the fly [x] add menu to exec arbitrary command -> added console [ ] that command can be what is selected @@ -20,6 +22,11 @@ [ ] console: automatically switch focus to the previous rootview when hiding it or selecting something from a treeview [ ] doc: detect file changes with hash +[ ] doc: save files with sudo (or other command) +[ ] doc: complete rewrite of history handling, by default the whole document is + selected for updates but when un-doing with a selection then the action + is limited to that part of the document (this is a feature from emacs) + [ ]: also make it configurable [x] add horizontal scroll [ ] add a cross to close tab [ ] add context menu to various things @@ -52,7 +59,7 @@ [x] selected + tab == indent up [x] selected +shift+tab == indent down [x] change alt+ to ctrl+ -[ ] add multi cursor system +[ ] doc: add multi cursor system [ ] add binding to open up a cheatsheet of keybinding, with a search feature [x] implement visual "ruler" at column 80 @@ -61,4 +68,13 @@ [ ] do not open doc in new tab if current tab has an unchanged document [ ] doc: add auto close brackets and quotes [ ] doc: highlight matching brackets and quotes pairs +[ ] doc: have a list of file extensions and handlers for those extensions, so + that we don't try to open like pdf files or tarballs and get jibberish [ ] view: implement get_scrollable_size() +[ ] tree: add icons for common actions + [ ] delete file + [ ] new file + [ ] rename file + [ ] move file + [ ] copy file + From 671c838b44ae13ed9e057de26f4b2a79260f7400 Mon Sep 17 00:00:00 2001 From: Alessandro Mauri Date: Sat, 27 Nov 2021 18:54:58 +0100 Subject: [PATCH 3/7] create direcotries in makefile --- makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/makefile b/makefile index 086adf2..e993463 100644 --- a/makefile +++ b/makefile @@ -28,7 +28,9 @@ install: lite # mkdir -p ${DESTDIR}${MANPREFIX}/man1 # cp -f us.1 ${DESTDIR}${MANPREFIX}/man1/us.1 # chmod 644 ${DESTDIR}${MANPREFIX}/man1/us.1 + mkdir -p ${DESTDIR}${PREFIX}/share/applications/ cp -f lite.desktop ${DESTDIR}${PREFIX}/share/applications/lite.desktop + mkdir -p ${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps/ cp -f icon.ico ${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps/lite.ico uninstall: From 6d995e71ed340dc1b99d378a8384792397d4058d Mon Sep 17 00:00:00 2001 From: Alessandro Mauri Date: Sat, 27 Nov 2021 19:20:25 +0100 Subject: [PATCH 4/7] minor formatting --- data/core/init.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/data/core/init.lua b/data/core/init.lua index ae93c02..ea3f667 100644 --- a/data/core/init.lua +++ b/data/core/init.lua @@ -104,12 +104,12 @@ function core.init() if file then local last_dir = file:read() file:close() - if last_dir then - info = system.get_file_info(last_dir) - if info and info.type == "dir" then - project_dir = last_dir - end - end + if last_dir then + info = system.get_file_info(last_dir) + if info and info.type == "dir" then + project_dir = last_dir + end + end end end end From 277025f91f1b831313c9b8f51a168cafb7060856 Mon Sep 17 00:00:00 2001 From: Alessandro Mauri Date: Sat, 27 Nov 2021 19:23:19 +0100 Subject: [PATCH 5/7] todo: resize treeview --- TODO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TODO b/TODO index 49e8cc1..d36ad32 100644 --- a/TODO +++ b/TODO @@ -77,4 +77,4 @@ [ ] rename file [ ] move file [ ] copy file - +[ ] tree: make treeview resizable From 00a2ecbd5543d3a2f6cf7a4a7edb5af51e918b4b Mon Sep 17 00:00:00 2001 From: Alessandro Mauri Date: Thu, 9 Dec 2021 18:46:23 +0100 Subject: [PATCH 6/7] added an icon 64x64 --- icon64.png | Bin 0 -> 1740 bytes makefile | 8 ++++++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 icon64.png diff --git a/icon64.png b/icon64.png new file mode 100644 index 0000000000000000000000000000000000000000..0c41fde3b2eb13c14b8d2a2f9c6eaa104e760930 GIT binary patch literal 1740 zcmZXVdstKF9mn4gf+AqCA~z?c&(tF1a&mG`a&o}roRbsofp8BhZ6FCG1q_2A1S>rO zY(a2}8xHqC=C%S}&_Efn9kk)oZ+X@&i?)uox(LJ)m)<4|#$NT#|@B4nf zzu$ZLJ@4D3O^Nf{61oKd;Fl0jr?Z~eXq&mL?fk&;gms=pq=p2b|CG-^^LcDP+z_9x z0ib3t089e_YwQrS1VAMOz=|FKyd8j`vW}s&7yvv1waJ<4?(QC%ju#4Hflw?Ehy_BJ zFMtICSS*&puoQw2NFNh+42Vlga61RzLf{5h{#0#ZIzddq%t+HXwR{zX#>hWg}=NFb27M9)aCyk9QQib}& zV1Fy@oH1kNlYwNA-D>Wlem%~Xo94rvS^tsh9K2Mw2G9G zq>Q34irh~tm8uEXJy*|fr)vkNnHy8JAB=a6x~67FMs6=GExP+}$|$~w!c_Mh!^3MtiAq9k#+=}_(J$;sxtwi!DY@kU&q<*-#_5sL?7W|m|T9Ny?xMLO){t6ApAo% zdp9?3Za&de&ou0oaoOU0+wBVrI~XD@A(!WU;nKxov-wTSDsWtNdPWCwG1Jp; zzVXxf+E2D+{O`z^ zf}mTYOgi__p}f4jxw*W&R&!33ENJ)5;hkZkzUt~4d(F4c*6jA%7LoFeSFEYnm#+J} zQo{$HZSwSbw#n}0!D-p*`_$KC%jiFxSCJoZ_`Y=y9z3YeJvLX*FwJ{*Z}z2hgG45D z6JkRALj%LYez$X52+w0WO$!QXpKYyM3kv25`##01X*}+Qy?f@xAhdDcMa!+Zk~7X$ zOB1Je;EZM2LlKlkExzC-I=tDma&1}vZpzQ3 zT;1u_m5C1Y=-)bSBx9iP+{du>xks5+(Ed?bE4ME!cf`0nV;b`gA^Lqz-~G*w47Wq| z=EKRdd;cyH78epTbCyAN$g^ubyD^FwVRIeueQ11HMe<~rzoaeg%W z=h=U$Ykb=Lg-?Zh{A%ZiHGYF_jx_$2Y|$KYF^&wSdI^r_pOw}uTo!f8+1WzweGR0bv9$Z&4e4uO{@bj1d9b? zSO7^gVF;HXIEqC<5Dq~Z&VXzGB`CETErs^)1dss6GQ}9qY9Qo4g3%wo+QbUNH!@UM z3vE^TxVEqY%P5w_NO(shLu~dR02ns_;y)$FuG+uroPKKq%1SBvd!6@;yfQ`>* n*9)^*=?S3FQexWJyTN)`$eM#tUfb;TgDeOV)G72;N?-RcSJ{!| literal 0 HcmV?d00001 diff --git a/makefile b/makefile index e993463..471a880 100644 --- a/makefile +++ b/makefile @@ -6,8 +6,10 @@ CFLAGS = -Wall -Werror -pedantic -O2 -std=c11 -fno-strict-aliasing \ -I${SRCDIR} -I${PREFIX}/include/ -DLUA_USE_POSIX -D_PREFIX="${PREFIX}" #-I/usr/include/SDL2 -I/usr/include/directfb -D_REENTRANT \ #-I/usr/include/lua5.2 -# remove this -LDFLAGS = -L${PREFIX}/lib -L/usr/lib/lua5.2 -lpthread -lm -lSDL2 -llua +# on void +LDFLAGS = -L${PREFIX}/lib -lpthread -lm -lSDL2 -llua5.2 +## on alpine +#LDFLAGS = -L${PREFIX}/lib -L/usr/lib/lua5.2 -lpthread -lm -lSDL2 -llua FILES != find ${SRCDIR} -name '*.c' OBJS = ${FILES:.c=.o} @@ -32,6 +34,8 @@ install: lite cp -f lite.desktop ${DESTDIR}${PREFIX}/share/applications/lite.desktop mkdir -p ${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps/ cp -f icon.ico ${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps/lite.ico + mkdir -p ${DESTDIR}${PREFIX}/share/icons/hicolor/64x64/apps/ + cp -f icon64.png ${DESTDIR}${PREFIX}/share/icons/hicolor/64x64/apps/lite.png uninstall: rm -f ${DESTDIR}${PREFIX}/bin/lite \ From 52e04febe26007fffc0331cb9aaddf41a193ac95 Mon Sep 17 00:00:00 2001 From: Alessandro Mauri Date: Thu, 9 Dec 2021 19:38:41 +0100 Subject: [PATCH 7/7] todo: fix memory leak --- TODO | 1 + 1 file changed, 1 insertion(+) diff --git a/TODO b/TODO index d36ad32..da24c31 100644 --- a/TODO +++ b/TODO @@ -78,3 +78,4 @@ [ ] move file [ ] copy file [ ] tree: make treeview resizable +[ ] FIX MASSIVE MEMORY LEAK