Commit Graph

2396 Commits

Author SHA1 Message Date
Jan200101 1345e9f345 Format renderer font scale code to be actually readable 2024-10-31 16:00:35 +08:00
dependabot[bot] a32d6fdb89 build(deps): bump softprops/action-gh-release
Bumps the github-actions group with 1 update: [softprops/action-gh-release](https://github.com/softprops/action-gh-release).


Updates `softprops/action-gh-release` from 1 to 2
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v1...v2)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-31 15:59:49 +08:00
Jan efa257ddbd
include unicode patch in lua meson wrap (#1908) 2024-10-22 19:19:42 +02:00
Guldoman 1ce8cd1d82
Add `minimum_thumb_size` and `{contracted,expanded}_scrollbar_margin` to `Scrollbar` (#1589)
* Add `minimum_thumb_size` to `Scrollbar`

* Add `{contracted,expanded}_scrollbar_margin` to `Scrollbar`
2024-10-22 13:05:07 -04:00
Adam Harrison 38d18395cb Lock LPM version. 2024-10-22 13:03:56 -04:00
Guldoman f81bd133b8
Add `inclusive` parameter to `Doc:get_text` (#1586)
This is needed to get the last character of the "selection".

For example:
```lua
doc:get_text(1, 1, #doc.lines, math.huge)
```
will return everything but the last newline, while
```lua
doc:get_text(1, 1, #doc.lines, math.huge, true)
```
will return the last newline too.
2024-10-22 12:59:55 -04:00
Takase b9e9041052
feat(core.emptyview): add name to emptyview (#1569)
* feat(core.emptyview): add name to emptyview

* fix(core.emptyview): set filename to empty
2024-10-22 18:44:04 +02:00
Takase f2a18cdce7
feat(core.emptyview): add name to emptyview (#1569)
* feat(core.emptyview): add name to emptyview

* fix(core.emptyview): set filename to empty
2024-10-22 18:43:50 +02:00
Guldoman 46b1499f4f
Fix multi-type usage in delimited patterns (#1740)
In the "end" pattern we weren't considering the multiple types.
2024-10-22 12:33:01 -04:00
Guldoman d486058875
Add support for relative `require`s (#1634) 2024-10-22 12:31:45 -04:00
Takase d925da47fa
Allow writing to hidden files on Windows (#1653)
* feat(system): add system.ftruncate

* fix: EPERM writing to hidden files on Windows

* chore(doc): fix capitalization

* refactor(system): make ftruncate length optional

* refactor(doc): don't specify length
2024-10-22 18:14:30 +02:00
ThaCuber 08fd994423
improve projectsearch (#1876)
* improve projectsearch

- stick status to top of view
- add horizontal scrolling
- added ellipsis at the end of the text if it's too long

* Reverted removal of 0 on yield.

---------

Co-authored-by: Adam Harrison <adamdharrison@gmail.com>
2024-10-22 18:10:33 +02:00
Adam 82d78350e2
Streamlined and simplified CI, and made it use lpm to install addons. (#1649)
* Streamlined and simplified CI, and made it use lpm to install addons.

Removed universal-dmg packager, as it is not necessary under the new workflow; a regular fat binary being packaged with the normal dmg works.

Incoprorated Guldo's suggestions.

Fixed minor issue.

Fixed slight issues.

Reverted to master.

Fixed nit.

Split up packaging steps.

Sigh,.

?

Fixed up x86 build.

Split Mac into two workers with a matrix.

Sigh.

Removed unecessary lines.

More descriptive name.

Split arch workflow for Mac.

Syntax error.

Spaced things out.

Fixed mac build.

Removed unecessary steps.

Takase's suggestions.

Removed unecessary `..`.

Modified patch to reference the new lua version (hopefully no other modifications needed).

Restored logic to create bundle.

New release workflow.

Changed to welcome plugin.

Changed build.

Added in package-portable to make this easier.

Corrected compiling arch.

Harmonized formats.

Remove package portable.

Fixed universal build.

Fix mispelling.

Sigh.

Sigh.

Sigh.

Sigh.

Sigh.

Sigh.

Sigh.

Sigh.

Sigh.

Sigh.

Sigh.

* Expanded things as per Takase's request.

* Renamed Mac to Darwin.

* Fixed missing variable.
2024-10-22 17:53:17 +02:00
Adam Harrison e8a4ed2a21 Additional small fixes for windows as part of the process API move to lua. 2024-10-22 11:48:51 -04:00
Adam Harrison 56b7d8abef Fixed minor typo from merge of #1854 for windows builds. 2024-10-22 11:33:41 -04:00
takase1121 a5d466d6cf arena_allocator: return lxl_arena instead of initializing an existing struct 2024-10-22 17:17:40 +02:00
takase1121 a25ab3c535 process: migrate arg validation and checking to Lua 2024-10-22 17:17:40 +02:00
takase1121 1f0533482b utfconv: add functions that use arena_allocator 2024-10-22 17:17:40 +02:00
takase1121 9293a317cd allocator: add arena_allocator
This allocator uses Lua userdatas for dynamic allocation
that is automatically freed when the current scope exits.
2024-10-22 17:17:40 +02:00
Jan 0966be64b0
remove lhelper script, build configuration and dependency support (#1906)
* remove lhelper script, build configuration and dependency support

* turn lhelper flag into a error
2024-10-22 17:12:23 +02:00
Jan de805aaf64
Implement logic for tracking target window (#1891)
this will be needed when SDL3 happens due to many more functions requesting a window handle

Signed-off-by: Jan200101 <sentrycraft123@gmail.com>
2024-10-22 17:09:20 +02:00
Guldoman 850aa25879
treeview: remove unused code (#1895)
It caused a lot of useless `system.absolute_path` calls.
2024-10-21 18:28:55 +02:00
Guldoman 219dc55eae
meta: remove `FUNDING.yml` 2024-10-11 05:42:09 +02:00
Adam 5b6c666652
Add keyboard shortcut to tooltips in `ToolbarView` (#1880) 2024-10-02 05:41:12 +02:00
Guldoman de118ab82a
Add primary selection support (#1729)
* Add support for primary selections

* Handle primary selection in `DocView`s
2024-09-13 13:31:15 -04:00
Adam f5c63d8c8f
Removed draw asserts for window renderer, because certain commands between frames may want to use draw commands to get the sizes of things. (#1878) 2024-09-12 21:20:38 -04:00
Takase 4b70c3e082
ci: use lite-xl-build-box-manylinux (#1877) 2024-09-06 12:49:14 -04:00
Takase 872364ded3
Configurable statusview icon (#1617)
* docs(core.statusview): fix item.visible being mandatory

* feat: make the line icon configurable

* fix: empty icons

* fix: use user specified font

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

* fix: never draw anything if disabled

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

* fix: always add stonks icon

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

* feat: add rgb functionality

* fix: reduce number of color changes

---------

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
2024-09-03 13:42:55 -04:00
Takase f5df5d6626 Revert "fix: avoid following symlinks in `common.rm`"
This reverts commit e3e8badf99.
2024-07-22 12:10:35 +08:00
Guldoman e3e8badf99 fix: avoid following symlinks in `common.rm` 2024-07-22 11:06:51 +08:00
Takase 27d95f63cb
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-07-13 02:39:49 +02:00
kramo 5a427a89b5 macos: Add proper platform-specific icon 2024-07-12 14:56:16 +08:00
takase1121 77d443c53d api/system: check if a window is created when firing DND events 2024-07-04 22:25:36 +08:00
takase1121 3d0344393c src/renwindow: correctly free texture and renderer 2024-07-04 21:57:33 +08:00
aia29 96579d9a7f add cuda 2024-07-04 13:09:00 +08:00
Adam 3bb27082ae
(fix): passed missing core.window to set_window_mode call (#1836)
* (fix): passed missing core.window to set_window_mode call

* Propogated fix to calls made from TitleView.
2024-06-30 07:26:01 +08:00
Takase e981fe46b5
Release v2.1.5 (#1840)
* chore: changelogs for v2.1.5

* chore: update versions
2024-06-30 07:21:35 +08:00
takase1121 482e8f3aed ci/release: adapt release note generation to the new script 2024-06-30 07:19:27 +08:00
takase1121 0129e9330f resources,scripts: use gh cli to fetch the correct release tags 2024-06-30 07:19:27 +08:00
Guldoman 9dd4b81b39 refactor(mac): adapt `LITE_USE_SDL_RENDERER` scaling to new windowing system 2024-06-25 13:42:17 +08:00
takase1121 adb64e6784 core/doc: fix wrong table index in Doc:merge_cursors
it was off by 1
2024-06-24 22:22:57 +08:00
Adam Harrison 1a293cd42e Fix window memory allocation bug. 2024-06-24 22:15:34 +08:00
Guldoman 7ca4c948bf fix(doc): convert `Doc:merge_cursors` parameter from "selection index" to table index 2024-06-24 22:14:53 +08:00
Takase 6cbfa44c95
core/rootview: fix dnd multiple folders into dock (#1828) 2024-06-23 13:09:07 +08:00
Guldoman 74fcd19ac2
fix(autoreload): wait a second before automatically reloading a file (#1823)
This is needed because we use `mtime` to determine if a file has actually changed, but on most systems this has a resolution of 1 second (and we truncate it to an integer anyways).

Without this wait, we would skip reloading a file that has been changed multiple times in the same `mtime` second, thus losing some data.
2024-06-23 10:01:50 +08:00
Guldoman face6af0da
fix(dirmonitor): avoid calling the change callback multiple times in the same notification (#1824) 2024-06-22 16:36:27 -04:00
Jan 1a045e5e86
move window creation and management to Lua (#1751)
* remove scaling logic from font code
for the time being its been hardcoded to 1 for the non SDL Renderer basewin setup, so nothing is lost for non MacOS users.
will be revisited in the future when scaling is improved with SDL3 and moved into scripts.

* remove unused window_renderer argument from font functions

* move window logic to lua, pass window via argument

* rename window creation functions `*_create`, `*_destroy`, add real init

* Set active window when processing frame

* get size directly from RenWindow, get active window size from renderer

* correct reverted draw calls

* fix window not reappearing on restart

* add simple logic to persist the core window

* fix style

* add renwindow documentation

* make windows hidden by default again

* reorder ren_update_rects execution, add comment to note future work
2024-06-22 15:01:39 -04:00
Adam dae74f01ae
Expand Process API (#1757)
* Initial commit of process framework.

* Fixed a small issue.

* Cleaned up old name.

* Harmonized with lua 5.4, and added documentation.

* Process is a userdata, not a table, so had to wrap it. Also added in `wait`.

* Added in documentation.

* Clarified documentation.

* Applied patch, and fixed undefined variable.

* Re-ordered documentation to be more sensible, added missing option.

* Added into start.

* Removed unecessary require.
2024-06-22 12:43:05 -04:00
fgelm01 5bca44f3bf
Handle static constexpr in language_cpp (#1806) 2024-06-22 12:15:33 -04:00
Takase 687aeda956
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-22 12:23:06 +08:00