Commit Graph

2363 Commits

Author SHA1 Message Date
Takase 2e8d59b86f
wasm cross file improvements (#1660)
* fix(wasm-cross): missing idbfs in newer emscripten

* refactor(wasm-cross): specify important option in cross file

* feat(wasm-cross): allow overriding emscripten path

* feat(wasm-cross): add file_packager as a binary
2024-02-06 14:38:12 +08:00
Takase 53876405fa
readme: add minimum supported OSes (#1711)
* readme: add minimum supported OSes

* README: add linebreak between sentences
2024-02-06 01:49:41 +01:00
Takase 8090c1aa29
process: fix unitialized variables (#1719)
* process: fix potential unitialized variables

* process: fix brace initializer error on Windows
2024-02-05 09:23:24 -05:00
Takase 3f31c27677
v2.1.3 (#1712)
* changelog: update changelog for v2.1.3

* update version in metadata

* changelog: fix formatting issue and release date

* appstream: update release date
2024-01-29 01:10:15 +01:00
Chloé Vulquin 1a5fd97c20
Add system.setenv (#1706)
* add system.setenv

* document system.setenv

* system.setenv: use wide versions of functions on windows

* do not include processenv.h

* system.setenv: report failure, including of utfconv

* system.setenv: free utfconv output
2024-01-23 00:22:44 +01:00
Luke aka SwissalpS 8cf40de860
Fix comment typos in data/core/{init.lua,dirwatch.lua} (#1549)
* comment typo in data/core/init.lua

* init.lua reword comment

* Update dirwatch.lua

Some wording is still whacky, maybe next time

* Update dirwatch.lua

* clear up can/may be not nil confusion

* falsey vs falsy new wording to help out

* falsey -> falsy

* Update data/core/dirwatch.lua

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

---------

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
2024-01-21 22:30:59 +01:00
Takase 0383e17475
process: style changes (#1709) 2024-01-21 10:18:32 +08:00
Takase dd69d7b9d0
language_js: support binary and octal representation (#1710) 2024-01-21 10:18:13 +08:00
vqn c561eb78e6
autoreload docs only if their filename matches an actual file (#1698) 2024-01-21 01:49:25 +01:00
vqn fd9b17ff15
reorder nagview options on doc:save error to be more consistent with other nagview confirmations (#1696) 2024-01-20 01:19:12 +01:00
Fiji c27d9aa0c0
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-20 01:04:49 +01:00
Chloé Vulquin e9a8dff884
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-20 08:02:46 +08:00
vqn 8b9b26e18f
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-13 13:49:26 +01:00
Takase 500ea2aefd
v2.1.2 (#1695)
* chore: update versions

* chore(changelog): update changelog for v2.1.2
2024-01-02 13:20:59 +01:00
Jan badcaef13b
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-06 12:51:45 +01:00
Adam Harrison cfbe68936a Fixed a minor bug, should close issue #1680. 2023-12-03 11:09:56 -05:00
ThaCuber f26eef14fa
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-03 06:44:07 +08:00
Guldoman e8ae7583bc
Expose plaintext syntax (#1652) 2023-11-30 10:53:01 -05:00
Guldoman 9a4831d5c2
Use `\r\n` for new files on Windows (#1596)
* Use `\r\n` for new files on Windows

* Add `config.line_endings`
2023-11-30 10:51:10 -05:00
Takase 142f0a17ba
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-11-30 10:33:24 -05:00
takase1121 ad1597125e chore(deps): update Lua 2023-11-30 11:19:18 +08:00
takase1121 eb7329d1fc chore(deps): update SDL2 2023-11-30 11:19:18 +08:00
takase1121 09a925f671 chore(deps): update pcre2 2023-11-30 11:19:18 +08:00
takase1121 cd1505c27d chore(deps): update freetype 2023-11-30 11:19:18 +08:00
takase1121 ccb4f88522 fix(ci,build.sh): un-hardcode lua subproject detection 2023-11-30 11:19:18 +08:00
Takase 1ed8f64608 Revert "feat(subprojects): update wraps (#1577)"
This reverts commit a97de87d86.
2023-11-30 09:28:24 +08:00
Guldoman 5cc8acb082
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-11-29 16:12:22 -05:00
Guldoman 3575898e62
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-11-29 15:44:48 -05:00
Adam 0e779bba0f
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-11-29 21:29:37 +01:00
ThaCuber 9615ead41b
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-11-29 14:12:43 -05:00
Guldoman e95094f0ca
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-11-29 11:11:46 -05:00
Guldoman 1c10bb894d
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-11-29 11:00:09 -05:00
Guldoman f457bc33fa
Fix editing after undo not clearing the change id (#1574) 2023-11-29 10:45:53 -05:00
Guldoman 5532b52ad8
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-11-29 10:40:47 -05:00
Guldoman ee93c3b08a
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-11-29 10:33:34 -05:00
Guldoman 8fd76d5d5c
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-11-29 10:21:58 -05:00
Takase a97de87d86
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-11-29 10:08:23 -05:00
Guldoman baa0c16e4d
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-11-29 09:55:38 -05:00
Guldoman dd75e676bc 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-11-29 09:11:39 +08:00
Guldoman a0ef2906a1
Limit `system.{sleep,wait_event}` to timeouts >= 0 (#1666)
Otherwise we might wait forever by mistake.
2023-11-29 09:07:33 +08:00
Daniel Margarido 55a19cd398
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-11-29 07:34:44 +08:00
Guldoman 921dba3243
Fix deleting indentation with multiple cursors (#1670) 2023-11-28 20:54:11 +01:00
Guldoman 954f60b5f8
Avoid considering single spaces in `detectindent` (#1595) 2023-11-28 20:54:00 +01:00
Takase 5d5cab1ee4
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 02:44:58 +01:00
Takase 332ea81e93
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 02:36:44 +01:00
ThaCuber f4b7cb584f
ease transparency of nagbar dim (#1658)
* ease transparency of nagbar dim

* tiny changes

* lerp alpha rather than the whole color
2023-10-31 16:24:36 -04:00
Guldoman 0570542de7
Make license time-independent (#1655) 2023-10-27 13:39:08 +02:00
Guldoman e67ac2818f
Sanitize tab index in `Node:add_view` (#1651)
* Fix `Node:add_view` not adjusting tab index after removing `EmptyView`

* Clamp tab index in `Node:add_view`
2023-10-23 17:58:02 -04:00
Takase 1620a92d54
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-21 19:17:49 +02:00
Guldoman 8a1a34c1ff
Set SDL hint to prefer software render driver (#1646) 2023-10-21 08:16:32 +02:00