Commit Graph
100 Commits
Author SHA1 Message Date
takase1121 7a2214ae0e main: fix not receiving text input 2025-05-19 08:52:43 +08:00
takase1121 94b2b28377 subprojects: fix freetype2 bzip2 dep issue 2025-05-19 08:52:41 +08:00
takase1121 409d2cd00b main: set the correct SDL_HINT_IME_IMPLEMENTED_UI 2025-05-19 08:47:47 +08:00
takase1121 fceb773d96 build.sh: update SDL3 version 2025-05-19 08:47:47 +08:00
takase1121 ceea55e97d appstream: fix screenshot link 2025-05-18 23:22:57 +08:00
takase1121 8664245843 build.sh: fix LTO option parsing 2025-05-18 23:16:10 +08:00
Takase 9511f55fc4 postrelease: ignore RC builds (#2082) 2025-05-18 23:16:10 +08:00
takase1121 d8f7b6e1be system: update window scale on scale changes 2025-05-18 23:16:09 +08:00
Takase 6d686e78db build.sh: build SDL3 with CMake (#2060)
* build.sh: support building SDL3 with cmake

* ci: install cmake

* ci: make msvc use bash to build again

* ci: use get-command to get link.exe

* build.sh: revert back to CMAKE_INSTALL_PREFIX

* ci: hardcode CMAKE_INSTALL_LIBDIR

* ci: set cc_ld to not step on cmake

* build.sh: less messing with cwd

* build.sh: fix prefix once and for all

* ci: skip installing cmake on macos to avoid warnings

* build.sh: pass MACOSX_DEPLOYMENT_TARGET to cmake

* build.sh: remove extra .. in configure command

* build.sh: remove unused variable

* build.sh: allow SIMD runtime detection

* build.sh: propagate LTO to SDL3
2025-05-18 23:16:07 +08:00
takase1121 bb05cf3e4d SDL3 port (#1756)
* update to SDL 3.2.0

* remove SDL wrap

* fix darwin and windows CI

* update build box, correct msys sdl3 dependency

* port leftovers from renderer backend to SDL3

* remove SDL main dep
the main implementation is now included in a header

* main.c: use SDL_main.h

This needs to be included to work.

* ci: use vcpkg and pkgconf to support SDL3 on MSVC

* ci: use 7z to create zip

* renwindow: create texture and surface suitable for the display

* system: remove trailing whitespace

* renderer: fix trailing whitespace

* system: fix checking the wrong argument

* system: port rmdir and stat to SDL3 API

* system: remove unneeded API level check

* system: fix wrong parameter index

* system: make set_window_hit_test and set_window_bordered accept a window

* docs/system: update docs

* system: restore some comments

* docs/system: add missing documentation for system.text_input

* system: use SDL_setenv_unsafe

* system: add back comment for setenv

* system,renderer: remove unnecessary SDL_ClearError calls

---------

Co-authored-by: takase1121 <20792268+takase1121@users.noreply.github.com>
(cherry picked from commit 2716f14b6903f055f6bdf010a7e4a3d040cf059d)
2025-05-18 22:55:30 +08:00
takase1121 16d81d0b9c ci: enable LTO for CI builds
(cherry picked from commit 75261a98a6723ce734360c0a3004c9e5cab04540)
2025-05-18 22:55:30 +08:00
takase1121 4ad47c1180 build.sh: add LTO support
(cherry picked from commit 3eab686fc16e836d05c28d352f45e1f14b8f2ebe)
2025-05-18 22:55:30 +08:00
Takase 1ada01e7b0 Update InnoSetup files (#1988)
* inno: update visual style to modern; support hidpi

* inno: fix add to PATH and add banner images

* inno: fix arch specification and default to x64compatible

* scripts: actually use x64compatible in package-innosetup.sh

* inno: fix unsupported windows warning

* gitignore: add trailing newline

(cherry picked from commit 819fa9d30e2c0e737fad519fbff63ce2baff4456)
2025-05-18 22:55:29 +08:00
Takase 590367a6e5 syntax: warn against malformed patterns and disable them (#2029)
(cherry picked from commit 3501f3d0bb6ee399ecb7cdf04cff8cf138b1ca02)
2025-05-18 22:55:29 +08:00
Takase 026d2a4271 language_cpp: add back digit separators (#2026)
* language_cpp: add back digit separators

* language_cpp: rewrite number matching in regex

* language_c: port digit separators over from language_cpp

(cherry picked from commit 8ea0393800bb59a214e8a6efd5b9fb69282803a9)
2025-05-18 22:55:29 +08:00
Takase 0d9431857e common: allow / and \ as PATHSEP on Windows when fuzzy matching files (#1992)
* common: allow / and \ as PATHSEP on Windows when fuzzy matching files

* common: fix PLATFORM == Windows

(cherry picked from commit 5d6ae412e76e69181a3b46c79b8408fbd55183c9)
2025-05-18 22:55:28 +08:00
Takase dec272d051 ci: add postrelease workflow to update docs and release winget packages (#1983)
(cherry picked from commit c61d5dd5c631a173d691121ebc6c7d4ec7279218)
2025-05-18 22:55:28 +08:00
takase1121 7a68eaa165 fix: use current char to determine col in DocView:get_x_offset_col (#1946)
Previously it would use the last char position, which resulted in incorrect values when the next char had a different size than the current one.

(cherry picked from commit f066c88e186a02b9912d7f102b541f514ae1aa35)
2025-05-18 22:55:20 +08:00
takase1121 52393aa75e move dependency resolving into source file (#1937)
These are only needed for building the actual project and not for managing resources or setting various flags.
Gets rid of the double `source-only` check and moves it closer to the consumer

(cherry picked from commit 64420f4366a290b3c3f48f0131a8f77312def595)
2025-05-18 22:54:39 +08:00
Takase 42cf5a630e renderer: pass errors via SDL_SetError (#1919)
(cherry picked from commit 90cce5edee579575025c388d995eed637c4ad0bf)
2025-05-18 22:54:39 +08:00
Takase 025e19d88e renderer: defer bitmap rendering when possible (#1856)
ren_font_group_get_width() is getting called a lot while not 100% of the
glyphs loaded from this function will be actually rendered. We can defer
the bitmap rendering to ren_draw_text.

(cherry picked from commit 1659f63dfc6fec7893673e7e95bbcd844ec0bda4)
2025-05-18 22:54:38 +08:00
Takase a23866511d Better wasm support again (#1779)
* wasm: add shell file for loading wasm module

* wasm: disable pcre2 jit

* wasm: add more configuration options

* cross/wasm: more build options

(cherry picked from commit 6575c297b50417eff0b82fd80340a192ba016b99)
2025-05-18 22:54:38 +08:00
Takase fdd5ab8ed0 common.sh: support OSTYPE == cygwin for MSYS2 (#2028)
(cherry picked from commit f30214464c0613c281c91be192c2ef8360f3543e)
2025-05-18 22:54:38 +08:00
takase1121 f1ab7de4ea chore: bump versions to v2.1.7 2024-12-05 22:22:30 +08:00
takase1121 9a3ade1bdd chore: update changelogs for v2.1.7 2024-12-05 22:20:46 +08:00
takase1121 2f208d452f process: call poll_process when getting returncode 2024-12-05 22:18:39 +08:00
Takase ad628da44d process: do not return nil until process exited (#1973) 2024-12-04 13:02:07 +08:00
takase1121 acf1daed7c ci: update docs on release 2024-12-04 13:02:06 +08:00
takase1121 ccf7383c34 ci: add winget releaser workflow 2024-12-04 13:02:06 +08:00
Takase 451bfacaf5 docview: prevent overscroll when DocView size is less than lh * 2 (#1971) 2024-12-04 13:02:06 +08:00
takase1121 8498a988e4 chore: bump versions to v2.1.6 2024-11-29 09:26:39 +08:00
takase1121 451bea592a chore: write changelogs for v2.1.6 2024-11-29 09:26:29 +08:00
takase1121 debfbcd986 ci: add releases permission to release CI 2024-11-27 20:53:36 +08:00
takase1121 fff5acda25 appimage.sh: temporarily fix the script to generate the appimage correctly 2024-11-27 20:53:35 +08:00
takase1121 e1a37cf194 ci: bump lite-xl-build-box-manylinux version 2024-11-27 20:53:35 +08:00
Takase 7c68b20115 feat(core.emptyview): add name to emptyview (#1569)
* feat(core.emptyview): add name to emptyview

* fix(core.emptyview): set filename to empty
2024-11-27 20:53:34 +08:00
takase1121 2e2305b9fe arena_allocator: return lxl_arena instead of initializing an existing struct 2024-11-27 20:53:33 +08:00
takase1121 cf40e254fe process: migrate arg validation and checking to Lua 2024-11-27 20:53:32 +08:00
takase1121 f84305b2b2 utfconv: add functions that use arena_allocator 2024-11-25 21:29:33 +08:00
takase1121 14489482ec allocator: add arena_allocator
This allocator uses Lua userdatas for dynamic allocation
that is automatically freed when the current scope exits.
2024-11-25 21:29:28 +08:00
Takase 55d84ea1a8 ci: use lite-xl-build-box-manylinux (#1877) 2024-11-25 21:28:29 +08:00
Takase 7a603f2a2d renderer: rewrite glyph cache (#1845)
* renderer: rewrite glyph cache

This commit splits the current GlyphSet-based system into 2 caches,
CharMap and GlyphMap, which maps codepoints -> glyph IDs and glyph IDs -> glyphs respectively.
Each GlyphMap contains a number of GlyphAtlas mapped by their width,
and each GlyphAtlas has a list of surfaces with the same width.
Surfaces within the GlyphAtlas acts like a bump allocator, but is flexible
enough to allow older GlyphAtlas surfaces to be recycled.

GlyphMetric now contains atlas_idx and surface_idx, which points to the correct surface.
Since GlyphAtlas supports rudimentary packing & allocation, we no longer render whole
GlyphSets and this speeds up rendering in most cases.

Tab width is no longer set with the hacky "modify the GlyphMetric" hack.

* renderer: set natlas to 0 after freeing

* renderer: fix printf warning

* renderer: fix memory leak

* renderer: better whitespace rendering

* renderer: fix ubsan warning when casting ints

* renderer: fix tab handling

There's a bug with inconsistent tab widths caused by fontgroups.

* renderer: fix glyphs being loaded over and over

* renderer: add glyphmap size

* renderer: store per-surface offset_y and use it to find best-fitting surface

* renderer: fix MSVC compiler error

* renderer: remove return value from ren_font_glyph

* renderer: refactor xadvance calculation

* renderer: fix double free SDL_RWops if FT_Set_Pixel_Size fail

* renderer: always try .notdef before U+25A1

* renderer: disable ren_font_dump yet again

Accidentally commited this change.

* renderer: remove unused imports

* renderer: fix double free with FT_Open_Face

* renderer: return SDL_Surface in font_find_glyph_surface

* renderer: bring back metric flags for future extension

* renderer: refactor xadvance calculation into macro

* renderer: fix comment

* renderer: store GlyphMetric directly in the surface

* renderer: remove duplicated comment

* renderer: rename font_find_glyph_surface to font_allocate_glyph_surface

* renderer: refactor glyphmetric retrieval into an inline function

* renderer: do not render glyphs with bitmap set to null

This is a weird edge case, but at least it shouldn't crash

* renderer: refactor face metric code into its own function

* renderer: actually check if glyph fits in surface

* renderer: rudimentary support for non-scalable faces

At least it won't render nothing on the screen

* renderer: check for font_surface instead of metric directly

This is safe and shorter

* renderer: fix indentation

* renderer: rename GLYPH_PER_ATLAS to GLYPHS_PER_ATLAS

* renderer: rename all GLYPH_PER_ATLAS correctly

* renderer: make utf8_to_codepoint slightly more durable

* renderer: fix compiler unsigned cast warning
2024-11-25 21:27:03 +08:00
takase1121 4d803204a8 src/renwindow: correctly free texture and renderer 2024-11-25 21:04:45 +08:00
takase1121 af9c8344cf chore: update versions 2024-06-29 22:46:15 +08:00
takase1121 e7c659c4e1 chore: changelogs for v2.1.5 2024-06-29 22:46:15 +08:00
takase1121 1140ceca94 ci/release: adapt release note generation to the new script 2024-06-29 22:46:14 +08:00
takase1121 474d696c84 resources,scripts: use gh cli to fetch the correct release tags 2024-06-29 22:46:14 +08:00
takase1121 4bfcd0d16e core/doc: fix wrong table index in Doc:merge_cursors
it was off by 1
2024-06-24 22:29:05 +08:00
takase1121 5ba8cfde6d core/rootview: fix dnd multiple folders into dock 2024-06-23 13:09:52 +08:00
Takase ce70fcf5dd macos: support drag-and-drop and default file associations (#1822)
* macos: support drag-and-drop and default file associations

* resources/macos: use LSItemContentTypes to narrow down files

* macos: support opening folders

* rootview: workaround macos weird dnd event timing

* core/rootview: rename variable and refactor if statement
2024-06-23 10:08:08 +08:00
Takase a8e5941337 language_cpp: backport number highlighting from c (#1818) 2024-06-23 09:02:56 +08:00
Takase c43996cf36 resources/macos: better macos installer background (#1816) 2024-06-23 09:02:55 +08:00
TakaseandGuldoman c3fa3859f2 subprojects: update lua,pcre2,sdl2 (#1812)
* subprojects: update lua,pcre2,sdl2

* meson.build: remove hidapi usage

* subprojects/sdl2: fix compilation with xinput

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>

---------

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
2024-06-23 09:02:55 +08:00
Takase 64b7625b62 Update macOS copyright notice (#1815)
* resources: update copyright in info.plist

* meson.build: dynamically generate current year

"present" may be misleading.

* resources/macos: remove unecessary newlines
2024-06-23 09:02:55 +08:00
Takase 8782c8064f ci: use latest macos images (#1804)
* ci: use latest macos images

* ci/build: clarify the purpose of md5sha1sum

* meson.build: remove hidapi usage

* ci: downgrade macos version for universal build

* scripts: codesign the universal binary with sha1 and sha256

* ci: revert back to macos-14 for universal

* ci/build: remove old comment
2024-06-23 09:02:55 +08:00
Takase 8432499f98 Update action dependencies (#1724)
* CI: update various action versions

The most significant change is action/upload-artifact@v4,
which does not support uploading artifacts of the same name.
This makes our lives significantly worse, but I don't know
if GitHub will remove v3 in future or not.

* CI: fix macOS universal artifact download

* CI: update release action versions

* CI: use containers only for building

* CI: fix multiline commands

* CI: try to fix multiline strings again

* CI: fix multiline strings again ugh

* CI: Fix ccache in containers

* CI: Fix quotes again

* CI: fix ccache

* CI: fix deprecated set-output command

* ci: update build box to v2.1.2

* ci: revert to softprops/action-gh-release

* ci: add name to release

* ci: remove name again

* ci: fix wrong outputs reference

* ci: add name

* ci: add missing name for each step

* ci: format yaml files

* ci/release: add names to unamed entries

* ci/release: fix MSYS2 not downloading deps

* ci/release: change to ncipollo/release-action

There is some weird issue with softprops/action-gh-release and I can't update an existing release.

* ci/release: allow updating releases

* ci/release: upload all artifacts, then download them at once

* ci/release: use a better name for job

* ci/release: add release as dependency

* ci/release: set tag for update release

* ci/auto-labeler: remove workaround for old autolabeler issue

* ci/release: remove the need of another bash -c

* ci/release: remove weird bash -c
2024-06-23 09:02:55 +08:00
Takase 6e7bcff493 ci: fix typo in release note template (#1801) 2024-06-23 09:02:54 +08:00
Takase e9a40c615f api/system: fix newlines returned by get_clipboard (#1788) 2024-06-21 08:06:44 +08:00
Takase bab7b3caf9 Generate release notes (#1774)
* ci: generate better release notes

* scripts: rename generate-release-note.sh

* ci/release: check out all the history

* ci/release: accept version from input
2024-06-21 08:06:18 +08:00
takase1121 f4311df1d6 chore: update version 2024-04-16 18:47:51 +08:00
takase1121 71d25f34b3 chore: update changelog 2024-04-15 11:47:00 +08:00
Takase c449632e85 ci: fix missing permission for creating releases (#1770) 2024-04-15 11:45:05 +08:00
takase1121 79b2457556 chore: update version 2024-04-15 10:39:36 +08:00
takase1121 bf35573725 changelog: add changes for 2.1.4 2024-04-15 10:32:25 +08:00
Takase 5296f8de4b scripts: not hardcode MSYSTEM (#1739) 2024-03-23 20:28:31 +08:00
takase1121andGuldoman 48aa350a3e Improve CommandView and autocomplete scroll behavior (#1732)
* Make command palette item scrolling more natural

Also add a config option for the maximum number of visible entries in the command palette.

* Make `autocomplete` item scrolling more natural

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
2024-03-23 20:27:47 +08:00
Takase 4ac4f72198 process: fix unitialized variables (#1719)
* process: fix potential unitialized variables

* process: fix brace initializer error on Windows
2024-03-23 20:26:43 +08:00
takase1121 c6a7ff98b0 appstream: update release date 2024-01-29 07:47:49 +08:00
takase1121 caf30574ed changelog: fix formatting issue and release date 2024-01-29 07:43:03 +08:00
takase1121 328ed55f83 update version in metadata 2024-01-21 15:13:26 +08:00
takase1121 b4d750013d changelog: update changelog for v2.1.3 2024-01-21 14:59:52 +08:00
Takase b856dc371a process: style changes (#1709) 2024-01-21 14:49:35 +08:00
Takase bbc524ad82 language_js: support binary and octal representation (#1710) 2024-01-21 14:49:28 +08:00
takase1121 b68efcd9e4 chore(changelog): update changelog for v2.1.2 2023-12-29 09:33:12 +08:00
takase1121 97a49661e0 chore: update versions 2023-12-29 08:47:22 +08:00
Takase 311651333a feat(process): allow commands and envs on proces_start (#1477)
* feat(process): allow commands and envs on proces_start

* refactor(process): copy process arguments once whenever possible

Refactors the code to use an arglist type which is just lpCmdline on Windows
and a list in Linux.
The function automatically escapes the command when it is needed, avoiding
a second copy.

This also allows UTF-8 commands btw.

* fix(process): fix invalid dereference

* refactor(process): mark xstrdup as potentially unused

* feat(process): add parent process environment when launching process

* fix(process): fix operator precedence with array operators

* fix(process): fix segfault when freeing random memory

* fix(process): fix wrong check for setenv()

* fix(process): fix accidentally initializing an array by assignment

* fix(process): clear return value if success
2023-12-01 10:12:16 +08:00
takase1121 9272f5ef2d chore(deps): update SDL2 2023-11-30 11:26:00 +08:00
takase1121 88dcb25396 chore(deps): update pcre2 2023-11-30 11:25:54 +08:00
takase1121 513432a784 chore(deps): update freetype 2023-11-30 11:25:46 +08:00
takase1121 43643a16c0 fix(ci,build.sh): un-hardcode lua subproject detection 2023-11-30 11:24:42 +08:00
Takase 34d163aa25 refactor(build): use dmgbuild to create dmgs (#1664)
* refactor(appdmg): make dmgs with dmgbuild

* fix(appdmg.sh): typo

* refactor(appdmg.sh): don't generate config on the fly

* fix(dmgbuild): icon file

* fix(gitignore): dmgbuild settings

* chore(resources): update readme with new files

* chore(resources/macos): add missing newline
2023-11-10 09:51:39 +08:00
TakaseandGuldoman 63d99d4431 feat(package): ad-hoc sign macOS bundles (#1656)
* feat(package): ad-hoc sign macOS bundles

* fix(package.sh): syntax error

* docs(readme): add instructions for self-signed builds

* docs(readme): grammar

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>

---------

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
2023-11-10 09:47:15 +08:00
TakaseandGuldoman 5d53b13cf4 fix(dirmonitor): deadlock if error handler jumps somewhere else (#1647)
* fix: deadlock if error handler jumps somewhere else

* docs(dirmonitor): fix wrong data type in error callback

* docs(dirmonitor): clarify coroutines and deadlocks

* docs(dirmonitor): wording

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>

---------

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
2023-10-24 20:16:52 +08:00
Takase 82589526c0 fix: dim rendering when antialiasing is turned off (#1641) 2023-10-16 12:05:01 +08:00
Takase 890e4882f3 fix(core): defer core:open-log until everything is loaded (#1585)
* fix(core): defer core:open-log until everything is loaded

* docs(core): document why core:open-log is opened in a thread
2023-08-26 08:53:05 +08:00
Takase 09dd111c61 docs(core.contextmenu): add documentation for contextmenu (#1567) 2023-08-26 08:52:29 +08:00
Takase eb27e543b4 ci(release): use lite-xl org (#1571) 2023-08-19 13:31:40 +08:00
Takase 07818934b6 feat(src/renderer): unify fontgroup baseline (#1560)
* feat(src/renderer): unify fontgroup baseline

* fix(src/renderer): use the first font's baseline for the text run
2023-08-19 13:31:18 +08:00
Takase 5d0bcc99fa Documentation for core.command (#1564)
* docs(core.command): add documentation

* fix(core.common): fix warnings

* docs(core.command): add "core." prefix to all custom types

* docs(core.command); add name as parameter to command.perform

* docs(core.command): fix typo and wording

* docs(core.command): add disclaimer to command.generate_predicate

* docs(core.command): fix wording for predicate

* docs(core.command): document command name

* docs(core.command): document the always_true predicate
2023-08-19 13:30:45 +08:00
Takase b5b6682303 docs(system): fix missing parameter for system.path_compare (#1566)
* docs(system): fix missing parameter for system.path_compare

* docs(system): fix missing parameter in function prototype
2023-08-19 13:30:45 +08:00
TakaseandGuldoman ad0d280ecc Documentation for core.common (#1510)
* docs(core.common): add and improve documentation

* refactor(core.common): remove unused variable to get_height()

* docs(core.common): remove messy newlines

* docs(core.common): fix wording

* docs(core.common): use integer instead of number

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>

* docs(core.common): update docs

the docs now follow the style in docs/ directory.
some of the changes suggested are also implemented.

* docs(core.common): fix typo

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>

* docs(core.common): restyle annoatations

Extra whitespaces are removed and @overload is used whenever possible.

* docs(core.common): fix various documentation errors

* docs(core.common): simplify unicode description

* docs(core.common): fix return value

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>

* docs(core.common): clarify common.bench for not being a benchmark

* docs(common): add disclaimer for numbers in common.serialize

---------

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
2023-08-19 13:30:45 +08:00
Takase 553251834b feat(src/renderer): stream fonts with SDL_RWops on all platforms (#1555)
* feat(src/renderer): stream fonts with SDL_RWops on all platforms

This fixes #1529 where the font itself carries the font file, which gets copied around.
This commit streams the file, so the file is not entirely in memory.

* style(src/renderer): use standard C types

* refactor(src/renderer): implement FT_Stream.close

* fix(src/renderer): fix SDL_RWops double free
2023-08-19 13:30:18 +08:00
Takase 7f84ed311b style(src/renderer): use FreeType header names (#1554) 2023-08-19 13:29:49 +08:00
takase1121 2a9b367e13 Move lineguide below blinking cursor, fixes #1488 (#1511)
* Move lineguide below blinking cursor, fixes #1488

* Added config_spec custom color
2023-08-19 13:26:01 +08:00
takase1121 64e5fd8ead fix(renderer): fix memory leak when freeing glyphsets 2023-08-19 12:47:19 +08:00
takase1121 4c320a10c0 docs(system): make all parameters for set_window_hit_test optional 2023-08-19 12:45:48 +08:00
takase1121 c0b1fe348f feat(bootstrap): return error string from C searcher 2023-08-19 12:45:15 +08:00
takase1121 6111b071ec fix(rencache): fix compiler warning for printing size_t 2023-08-19 12:45:15 +08:00
takase1121 2517d34113 ci(build): update action dependencies 2023-08-19 12:44:19 +08:00
Takase 1952848caa fix(process): check for HANDLE_INVALID (#1475) 2023-08-19 12:44:19 +08:00