Commit Graph

2607 Commits

Author SHA1 Message Date
George Sokianos ad4c221dd8 Manual sync with 2.1.3 tag 2024-02-11 17:51:12 +00:00
George Sokianos 66fb996e76 Merge branch 'v2.1.3-upstream' into amiga2.1 2024-02-11 16:02:19 +00: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
vqn a389adbaf5
autoreload docs only if their filename matches an actual file (#1698) 2024-01-21 14:48:56 +08:00
vqn df12a5dde6
reorder nagview options on doc:save error to be more consistent with other nagview confirmations (#1696) 2024-01-21 14:48:44 +08:00
Fiji e353c5322a
Improve number highlighting for python syntax highlighting (#1704)
* Improve number highlighting for python syntax highlighting

Adds support for octal and binary representation, as well uppercase characters (X, B and O)

* add underscore and negative hex/oct/bin value support

* Removed | from pattern
2024-01-21 14:48:21 +08:00
Chloé Vulquin 4ae92ae128
Memory fixes (#1705)
* fix: free-before-init in renwin_init_surface when using sdl renderer

`ren->rensurface.surface` presupposes zero-initialized rensurface.
Rensurface was not actually zero-initialized.
It is now.

* fix: heap buffer overflow in process_env_free

`process_env_free` presupposed that it was null-terminated.
Pass length to free instead.

* use calloc instead of memset for zero-init

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

---------

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
2024-01-21 14:42:46 +08:00
vqn 2ce8c58bea
Fix doc:create-cursor-previous/next-line with tabs (#1697)
* use DocView.translate to split cursor on previous/next line

* use dv.doc instead of doc()
2024-01-21 14:40:41 +08:00
George Sokianos d0b86296c3 Updated the readme for the 2.1.2r1 release 2023-12-29 11:25:30 +00:00
George Sokianos 71558986d3 innosetup changes 2023-12-29 10:34:37 +00:00
Velosofy d67a951d31 Add "Open with Lite XL" to windows' context menu (#1333)
Closes #423
2023-12-29 10:34:37 +00: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
vqn 9c21903af7
add autocompletion to multicursor (#1394)
* use Doc:remove
2023-12-29 08:47:21 +08:00
Adam Harrison 1d4e01a192
Fixed a minor bug, should close issue #1680. 2023-12-29 08:47:21 +08:00
ThaCuber f1bdd840a1
fix nagbar failed save message (#1678)
* fix nagbar failed save message

- visually separated statements with a `.`
- first statement slightly rewritten
- use `'` rather than `"`

* yeahhhh no back to `"`
2023-12-29 08:47:05 +08:00
George Sokianos ffc5e25a72 Updated the version and added some info in the readme 2023-12-26 13:58:21 +00:00
George Sokianos 5c983f10b5 Merge branch 'master' into amiga2.1 2023-12-26 13:36:13 +00:00
Jan 7b67a5d81b turn window_renderer into managed pointer (#1683)
* turn window_renderer into managed pointer
this will make it easier to move it into userdata in the future

* remove unused function, remove comment
2023-12-26 13:16:33 +00:00
Adam Harrison cca61ab8ec Fixed a minor bug, should close issue #1680. 2023-12-26 13:16:33 +00:00
ThaCuber c45463459c fix nagbar failed save message (#1678)
* fix nagbar failed save message

- visually separated statements with a `.`
- first statement slightly rewritten
- use `'` rather than `"`

* yeahhhh no back to `"`
2023-12-26 13:16:33 +00:00
Guldoman 39993a6d93 Expose plaintext syntax (#1652) 2023-12-26 13:16:33 +00:00
Guldoman a29327e375 Use `\r\n` for new files on Windows (#1596)
* Use `\r\n` for new files on Windows

* Add `config.line_endings`
2023-12-26 13:16:33 +00:00
Takase 7111b8a6c9 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-26 13:16:33 +00:00
takase1121 a9ac33429e chore(deps): update Lua 2023-12-26 13:16:33 +00:00
takase1121 ad1fad2632 chore(deps): update SDL2 2023-12-26 13:16:33 +00:00
takase1121 79bae532b9 chore(deps): update pcre2 2023-12-26 13:16:33 +00:00
takase1121 41813604e1 chore(deps): update freetype 2023-12-26 13:16:33 +00:00
takase1121 7b064bae6b fix(ci,build.sh): un-hardcode lua subproject detection 2023-12-26 13:16:33 +00:00
Takase 2d36359e6e Revert "feat(subprojects): update wraps (#1577)"
This reverts commit a97de87d869c227c2d41595d76ecafdc29e76bef.
2023-12-26 13:16:33 +00:00
Guldoman dac8d1ac8e Improve font/color change detection in `language_md` (#1614)
* Delay setting font for custom `language_md` token types

* Improve font/color change detection in `language_md`
2023-12-26 13:16:33 +00:00
Guldoman 5719f4de6f Use x offset to define render command rect in `rencache_draw_text` (#1618)
* Return x offset for the first character in `ren_font_group_get_width`

* Use x offset to define render command rect in `rencache_draw_text`
2023-12-26 13:16:33 +00:00
Adam e14af4604a Reverted cursor API to something more compatible with old API. (#1674)
* Reverted cursor API to something more compatible with old API.

* Implemented discord discussion.

* Reduced thiccness of overwrite cursor.
2023-12-26 13:16:33 +00:00
ThaCuber f43cfc4a94 Text overwriting (#1495)
* added text overwriting

* rewrote `DocView:draw_caret` to not use the order of draws

* forgot to delete some old code in `DocView:draw_overlay`
also added a temporary solution to overwriting
and added the missing arguments in `DocView:draw_ime_decoration`
and fixed `DocView:draw_caret`

* accidentally broke the `draw_caret` call in `draw_overlay` in the process

* multiline

* fixed calling `Doc:get_char` as a function
that, in turn, crashed the editor because "can't index a number"

* move and rename some stuff

* remove unneeded extra check

I just had to change the `~=` to `<` in the second condition

* overwrite disregards pasting text

* disregard overwrite on selections; doc only removes selection

* Fixed error where `doc` was used, instead of `self`.

---------

Co-authored-by: ThaCuber <70547062+ThaCuber@users.noreply.github.com>
Co-authored-by: Adam Harrison <adamdharrison@gmail.com>
2023-12-26 13:16:33 +00:00
Guldoman 234dd40e49 Fix patterns starting with `^` in `tokenizer` (#1645)
Previously the "dirty" version of the pattern was used, which could 
result in trying to match with multiple `^`, which failed valid matches.
2023-12-26 13:16:33 +00:00
Guldoman ee02d0e0b6 Fix `language_js` regex constant detection (#1581)
* Fix `language_js` regex constant detection

* Simplify regex constant detection in `language_js`

* Add more possessive quantifiers in `language_js` regex constant detection

This avoids more catastrophic backtracking cases.

* Allow `.` after regex constant in `language_js`
2023-12-26 13:16:33 +00:00
Guldoman de043f2e13 Fix editing after undo not clearing the change id (#1574) 2023-12-26 13:16:33 +00:00
Guldoman 9301220d26 Fix selecting newlines with `find-replace:select-add-{next,all}` (#1608)
* Avoid adding existing selections in `select_add_next`

* Use the first available selection as delimiter in `select_add_next`

* Fix returning searches with newlines in `search.find`

* Fix repeat search when the last result spanned multiple lines
2023-12-26 13:16:33 +00:00
Guldoman 2571e17d1b Fix `core.redraw` when window is not focused (#1601)
* Execute at least one step when window has no focus

This way if `core.redraw` is set, it's respected.

* Fully run threads at least once when window has no focus

This allows threads that set `core.redraw` (like `projectsearch`) to 
continue running even after the window loses focus.

"Fully" here means that `run_threads` has gone through *all* the "timed 
out" coroutines at least once.
2023-12-26 13:16:33 +00:00
Guldoman 4e2f70e5ee Scale mouse coordinates by window scale (#1630)
* Update window scale on resize

* Scale mouse coordinates by window scale

* Avoid scaling mouse coordinates while using `LITE_USE_SDL_RENDERER`
2023-12-26 13:16:33 +00:00
Takase 52d224ac6b feat(subprojects): update wraps (#1577)
* feat(subprojects): update SDL2 wrap

* fix(meson.build): add sdl2main as dependency on Windows

* fix(meson.build): don't load sdl2main on non-Windows platforms

* feat(subprojects): update freetype version

* feat(subprojects): update pcre2 to latest version

* feat(subprojects): update lua to latest version

* feat(lite_xl_plugin_api): add lua_closethread to symbols list

* fix(meson.build): fix meson error with features and booleans

* fix(meson.build): fix wrong variable name

* feat(subprojects): update wraps again

* ci(build): fix lua subproject not found

* ci(build): use awk instead of grep and sed
2023-12-26 13:16:33 +00:00
Guldoman 3ee903b16c Fix `dirmonitor` sorting issues (#1599)
* Use `PATHSEP` in path-related functions

* Don't stop on digits when getting the common part in `system.path_compare`

* Avoid sorting multiple times in `dirwatch.get_directory_files`

This also fixes the timeout detection in `recurse_pred`.
2023-12-26 13:16:33 +00:00
Guldoman 1dceaf65f5 Fix running `core.step` when receiving an event while not waiting
When `time_to_wake` was <= 0, so when a coroutine needed to be executed 
as soon as possible, we didn't check for events, so we only performed a 
`core.step` with the blink timer.
This resulted in jerky reactions to input.
2023-12-26 13:16:33 +00:00
Guldoman c4f9542509 Limit `system.{sleep,wait_event}` to timeouts >= 0 (#1666)
Otherwise we might wait forever by mistake.
2023-12-26 13:16:33 +00:00
Daniel Margarido 86b89c402d Fixed issue with set_target_size passing the wrong value to plugins (#1657)
* Fixed issue with set_target_size passing the wrong value to plugins that are split on the right and activated from the settings UI.

* Added position awareness for the all resize_child_node calls.
2023-12-26 13:16:33 +00:00