Commit Graph

2153 Commits

Author SHA1 Message Date
Guldoman bf35417f82
Don't calculate widths per-uft8-char when not needed (#1409) 2023-08-19 12:38:49 +08:00
Takase 84c7bb9de6
Asynchronous process reaping (#1412)
* refactor(process): introduce process_stream_handle separate from process_handle

* feat(process): introduce process_handle helper functions

* feat(process): add asynchronous process reaping

* feat(process): wait for shorter period if possible

* style(process): remove unecessary brackets

* style(process): fix parentheses

* refactor(process): remove useless setvbuf call

* style(process): remove unecessary value

* refactor(process): add size field into kill_list

* refactor(process): use SDL_Delay for sleeping

* style(process): remove trailing whitespace

* fix(main): destroy window before closing lua

* fix(process): check for timeout correctly

* refactor(process): remove unecessary if check

* refactor(process): remove size from the list

* fix(process): fix invalid delay calculation

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

---------

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
2023-08-19 12:38:49 +08:00
Guldoman 89864ee88c
Aggregate `SDL_Surface`s and their scale in `RenSurface` (#1429) 2023-08-19 12:38:49 +08:00
Guldoman a61531dbf0
Use clipping functions provided by SDL (#1426) 2023-08-19 12:38:35 +08:00
Guldoman 1d0725f904
Improve text width calculation precision (#1408)
In some extreme cases (~30000 chars) text width precision takes a hit.
Using double instead of float fixes that.
2023-08-19 12:38:35 +08:00
Takase 32860c111e
refactor(main): move SetProcessDPIAware to manifests (#1413) 2023-08-19 12:38:35 +08:00
Guldoman 8c47fad637
Split `Command` struct into different structs for each command type (#1407)
This reduces the space needed for each command.
2023-08-19 12:38:34 +08:00
Takase f685293417
Add manifest on Windows (#1405)
* fix(gitignore): add exclusion for manifest files

* feat(windows): add application manifest

* feat(build): use application manifest on windows

* refactor(build): use genrate_file to generate the manifest

* style(manifest): remove trailing whitespace
2023-08-19 12:38:34 +08:00
Guldoman 95611366bb
Use correct view for scrolling to `find-replace:repeat-find` results (#1400) 2023-08-19 12:38:34 +08:00
vqn 067271bc02
fix incorrect x_offset if opened docs have different tab sizes (#1383) 2023-08-19 12:38:13 +08:00
Adam c8f033ec8b
Fixed up some post 5.1/jit Symbols (#1385)
* Updated k functions to have appropriate method signatures for 5.3 and up.

* Fixed up some inconsistent signatures that I forgot.
2023-08-19 12:38:13 +08:00
Guldoman b0e524dd15
Improve `DocView:get_visible_line_range` precision (#1382) 2023-08-19 12:37:50 +08:00
Jefferson González 24491bc3fd
plugins scale: also rescale style.expanded_scrollbar_size (#1380) 2023-08-19 12:37:50 +08:00
Jefferson González 70ed171612
NagView: properly rescale on scale change (#1379)
* drop font option since style.font is always used
2023-08-19 12:37:49 +08:00
Jefferson González 6925c06599
Improved plugins config table handling (#1356)
* Warns user if trying to disable a plugin that is already
  enabled when doing `config.plugins.plugin_name = false` and also
  prevents replacing the current plugin config table with the false
  value to mitigate runtime issues.
* Uses a merge strategy by default when assigning a table to a plugin
  config to prevent a user from removing a plugin default config values
  as experienced and explained on this issue lite-xl-plugins#158
* This change is basically backwards compatible, but will require a
  change on the settings ui plugin on how it checks for already
  enabled plugins, since rawget will no longer be a working hack
  or workaround for this.
* As suggested by Adam dropped loaded key and switched to package.loaded
2023-08-19 12:37:29 +08:00
Takase b95fdfcf5f
fix: exec() error not returned to parent (#1363)
* fix: exec() error not returned to parent

* chore: remove accidental lua.h inclusion
2023-08-19 12:37:20 +08:00
takase1121 218ba3ebac
Context menu fixes and keyboard navigation (#1338)
* fix Doc contextmenu not registering commands if scale plugin is not found
* fix TreeView contextmenu commands not working if the mouse hovers DocView
* add keyboard navigation to TreeView contextmenu
* fix incorrect contextmenu predicate

Co-Authored-By: vqn <85911372+vqns@users.noreply.github.com>
2023-08-19 12:36:39 +08:00
Adam 017711b369
Getting rid of annoying forward slash on windows. (#1345) 2023-08-19 12:30:41 +08:00
jgmdev b8eb6865a6
gh workflow: fix path to macOS arm64 cross file 2023-08-19 12:30:41 +08:00
Jefferson González 03d11c869d
ci: fix msys build now requiring ca-certificates (#1348)
Thanks to Guldoman who discovered the cause for meson failing to
validate SSL certificates which turned out to be MSYS now requiring
ca-certificates package installed for the different architectures.
2023-08-19 12:30:41 +08:00
Jan a951c3cd39
pass RenWindow by argument (#1321)
* pass RenWindow to all renderer functions that need it

* pass RenWindow to all rencache functions that need it
2023-08-19 12:30:41 +08:00
Adam Harrison 5907118683
Added missing header declaration. 2023-08-19 12:29:18 +08:00
Jefferson González 95f18a1148
plugin api: allow usage on multiple source files (#1335)
As discussed with Adam on discord current Lite XL Lua Plugin API was not
working on native plugins with more than 1 source file since imported
symbols were not exposed to other unit files. The issue was tackled on #1332
but the solution introduced another issue when Lite XL was dynamically
linked to the system lua. So we opted to tackle this by using function
wrappers around the function pointers.
2023-08-19 12:29:18 +08:00
Guldoman bddb5e274d
Avoid drawing hidden text in `DocView:draw_line_text` (#1298)
* Stop drawing text past the `DocView` edge in `DocView:draw_line_text`

* Don't add draw commands if they fall outside the latest clip

The check was previously done with the window rect, so this will reduce 
a bit more the number of commands sent.
2023-08-19 12:28:48 +08:00
Jan d54a5d0672
remove static libgcc from meson (#1290) 2023-08-19 12:28:48 +08:00
Adam Harrison 4c18cf6744
Updated dummy method signature to match prototypes. 2023-08-19 12:28:48 +08:00
Guldoman a9d8f12cb7
Make empty groups in `regex.gmatch` return their offset (#1325)
This makes `regex.gmatch` behave like `string.gmatch`.
2023-08-19 12:28:47 +08:00
xwii 38fa9f976c
Use `table.move` to implement `common.splice` (#1324)
* Use `table.move` to implement `common.splice`

* Disallow negative `remove` in `common.splice`
2023-08-19 12:28:47 +08:00
adityaraj ae218bc005
Create Renderer Only When It Doesn't Exist (#1315) 2023-08-19 12:28:21 +08:00
Jan c8afe3d1bf
replace uses of SDL_Window with RenWindow (#1319)
Since Renwindow contains our instance of SDL_Window we can use this
to simplify future logic to create separate window instances
2023-08-19 12:28:21 +08:00
Takase 2d0ddc302f
Reorganize resources/ + wasm target (#1244)
* add README.md to resources directory
* add cross/ directory for meson cross files
* fix readme list syntax error
* fix reflink
* disable ASYNCIFY_ADVISE by default
* use executable names instead of hardcoding paths
2023-08-19 12:28:21 +08:00
jgmdev 291e7eab6f
packaging: use master branch for plugin addons 2023-08-19 12:28:21 +08:00
sammyette 1984573214
fix: center title and version in emptyview (#1311)
* fix: divide by amount of lines
2023-08-19 12:28:21 +08:00
Jan f5a224999a
defer lua error until after cleanup (#1310) 2023-08-19 12:28:20 +08:00
Jefferson González 4b6134a839
plugin api: added missing luaL_typeerror (#1313) 2023-08-19 12:28:20 +08:00
jgmdev 60f0e3f3da
Packaging Scripts: updated widgets install location 2023-08-19 12:28:20 +08:00
Guldoman f00f41b468
`linewrapping`: Disable horizontal scrolling when enabled (#1309) 2023-08-19 12:28:20 +08:00
Julien Voisin 1ab320bb9b
Handle readlink errors (#1292) 2023-08-19 12:28:19 +08:00
Guldoman 138cea45d5
Make `dirwatch` sorting compatible with what `file_bisect` expects (#1300)
The result of `a.filename < b.filename` is sometimes different from 
`system.path_compare(a.filename, a.type, b.filename, b.type)` which 
causes issues to `file_bisect`, as it expects the sorting to be done 
with `system.path_compare`.
2023-08-19 12:28:19 +08:00
Julien Voisin d86413cc30
Don't set a value twice (#1306) 2023-08-19 12:28:19 +08:00
Julien Voisin d06c9f401c
Fix a memory leak (#1305)
`font` was not freed upon error.
2023-08-19 12:28:19 +08:00
Julien Voisin d755fa6fba
Make api_require's nodes const (#1296) 2023-08-19 12:28:18 +08:00
Takase 69ce580970
do not allow users to create an empty font group (#1303) 2023-08-19 12:28:18 +08:00
Guldoman bd4e64cc7e
Allow command buffer to be expanded (#1297) 2023-08-19 12:28:18 +08:00
Dave 0fa0a59c8b
Minor typos in init text 2023-08-19 12:28:18 +08:00
Jefferson González 3491eb464d
Bump version to 2.1.1 (#1284)
* updated wraps
* updated release date
2022-12-28 22:03:36 -04:00
jgmdev 79908baed6 regex: properly call pcre2_jit_compile 2022-12-28 19:40:20 -04:00
Guldoman 74349f8e56
Fix horizontal scroll with touchpad on MacOS 2022-12-28 17:26:57 +01:00
Jefferson González 870d685b59
contextmenu: adjust y positioning if less than zero (#1268)
* use clamp for both x and y coords
2022-12-28 02:51:24 -04:00
Quinten Kock 3fda8c0a09
Fix userdata APIs for Lua 5.4 in native plugin interface (#1188)
* Reintroduce some missing Lua API's from native plugin API

* Add new upvalue functions to header

* Fix things that are actually macros in current lua

* Introduce lua_insert,replace,remove macros from lua5.4
2022-12-27 23:39:28 -05:00