aboutsummaryrefslogtreecommitdiff
path: root/data/core
AgeCommit message (Collapse)Author
11 daysTry to make JIT more predictable, less flushing (#388)Jefferson González
Previous flags been use were causing trace flushes, these ones seem to work better after several benchmarks.
13 daysImageView: rescale svg images directly from source (#383)Jefferson González
* ImageView: rescale svg images directly from source Rescaling directly from source allows non pixelated rendering of svg images. For this we added a new canvas.load_svg_image(path, w, h) function that wraps `IMG_LoadSizedSVG_IO` * Always reference original on scale 1 to prevent duplicate
2025-12-11ImageView: keep scale at 1 if width less than viewjgmdev
Keeps the image scale at 1 when its width doesn't exceeds the ImageView width and the scale mode is set to "fit".
2025-12-10Guard against null windows on draw operations (#381)Jefferson González
When sending draw operations outside of a renderer begin_frame and end_frame, a segfault would occur since no target window is set. These changes prevent the editor from crashing down and instead report the error.
2025-12-09Fix inconsistency on toolbarview dest_size (#378)Jefferson González
On fractional scales the calculation of dest_size can be inconsistent leading to undesired move_towards processing. Also: * Introduced common.get_caller_info(stacklevel) to help troubleshoot this kind of issues. * Adapted move_towards to use an epsilon comparison (thanks to Mike Pall for suggestion and correction on wrong assumption from my part).
2025-12-08Remove ci lua system overrides and disable pgo sqlite downloadjgmdev
2025-12-07Disable system sleep and poll_event to try fix CI stalljgmdev
2025-12-07Remove unneccesary save when loading project modulejgmdev
2025-12-07Remove leftover print statementjgmdev
2025-12-07system.wait_event on dummy vid driver just returnjgmdev
2025-12-07Other changes to prevent pgo from stallingjgmdev
* Added initial redraw to pgo script. * Print initial message on pgo to troubleshoot CI. * Disabled ccache on linux since no longer needed. * Do not use exec on scripts/run-local, may cause issues on CI * Override system.wait_event on dummy driver to prevent stalls
2025-12-05Add the option to change background mode of images (#371)Jefferson González
The options are: * "grid" - displays gray squares * "solid" - displays a configurable color * "none" - no background is displayed New config flags: ```lua ---The type of background drawn behind the images. --- ---Defaults to "grid". ---@type "grid" | "solid" | "none" config.images_background_mode = "grid" ---The color used for the background of transparent images when the ---background mode is set to solid. --- ---Defaults to "#ffffff". ---@type renderer.color config.images_background_color = { common.color "#ffffff" } ```
2025-12-05Added in check for the blink timer so that we don't needlessly redraw. (#2053)Adam
2025-12-05Allow for negative priority numbers.Adam Harrison
The plugin loading system from https://github.com/lite-xl/lite-xl/pull/1881 was designed to allow for negative priority plugins, however the regex was not modified accordingly. This fixes that deficiency.
2025-12-05feat: add SDL file picker (#2072)Guldoman
* feat: make custom SDL events registration cleaner * feat: add `system.open_file_dialog` * feat: implement `core.open_file_dialog` * feat: add `allow_many` to `{system,core}.open_file_dialog` * feat: add `system.get_sandbox` * feat: when in a sandbox use file picker in `core:open-file` command * refactor: avoid spamming `get_custom_event` in `dirmonitor_check_thread` * feat: set `ptr` in `lxl_arena_copy` to `const` * feat: move `system.open_file_dialog` options to table, add support to filters, title, accept and cancel labels * feat: add `system.{save_file,open_directory}_dialog` * feat: add `core.{save_file,open_directory}_dialog` * fix: use `SDL_zero` instead of `{}` for `DialogOptions` initialization * fix: use new dialog options style in `open_file` * feat: add dialog support to `core:{change,open}-project-folder` and `core:add-directory` * feat: rewrite custom events to make use of SDL Properties This will allow us to expose the custom event functions to native plugins. * feat: log failure if dialog errors out in core commands * build: enable SDL Dialog subsystem
2025-12-05Added generic storage system and use on workspace plugin (#1929)Adam
Fixed small bug with saving workspaces on project change.
2025-12-05Rearrange Plugin Loading and SDL Initialization (#1881)Adam
Moved around plugin initialization. Fixing restarting when changing projects. Added in autorestart plugin. Moved screensaver call to after video subsystem init. Kept initailization of previous_find and previous_replace. Allowed priority regex to take a decimal place. Fixed priority regex. Fixed version mismatch error. Removed hints.
2025-12-04fix(doc): don't modify `doc` with empty clipboard paste (#2185)Guldoman
2025-12-04Resolved some type-complaints that are detected by LuaLS (#2120)Alexander Björkman
* Resolved type-complaints that are detected by LuaLS * Respond to feedback on PR
2025-12-04Improve folder drag-and-drop experience (#1830)Takase
* core/nagview: fix queue items not being displayed * core/rootview: show user options when folders are dropped * Changed to add_project. --------- Co-authored-by: Adam Harrison <adamdharrison@gmail.com>
2025-12-04Fixed timeout in process:wait; comparaison was incorrect, and would ↵Adam Harrison
generally lead to erroneous instantaneous returns.
2025-12-04Add canvas and image loading support (#370)Jefferson González
This PR rebases Guldo canvas branch https://github.com/Guldoman/lite-xl/tree/PR_canvas and adds other adaptations and changes as detailed below: This change moves the canvas to use the generalized rencache system to perform most draw operations (text, rectangles, polygons, set pixels). It also introduces the following: * Polygon drawing support * New load_image function. * New clear, render and save_image methods. * Image loading and saving support using sdl3_image * Added basic image viewer. * New core.open_image function. * Adaptations to TreeView to support opening images on viewer. * Add context menu entry to TreeView to allow opening svg images as text * New commands for image viewer: auto-fit, zoom-in/out * New status bar item to show image viewer details * Adds custom meson wrap for sdl3_image * Also, other changes to make things better with LuaJIT --------- Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
2025-11-28Fix the statusview tooltips jumpy text (#367)Jefferson González
Fixes the issue described on #359 by performing the rounding of the coords given to renderer.draw_text from Lua side.
2025-11-27Fix EmptyView AKA Welcome Screen flashing (#366)Jefferson González
This was caused by an out of order call of update and draw due to how widgets bypass update and draw operations to reduce cpu usage. The widget library was updated to prevent this issue from happening. Also this PR includes a change on settings ui to schedule an update when the update method is called by the root system without setting a width and height first, which is needed to properly process the positioning calculations.
2025-11-26Fix equal float comparison returning false (#363)Jefferson González
Discovered a possible LuaJIT bug which returns false when comparing two equal float numbers, which returns true when converting both numbers to a string and comparing them... This issue caused move_towards latest changes to always force a redraw impacting rendering performance.
2025-11-26Scale initialization fixes (#362)Jefferson González
Fixes config.mouse_wheel_scroll not properly scaling at startup by loading the config after the SCALE has been properly detected. Also adds some missing style flags to the rescale logic of the scale plugin and adjusts the settings ui plugin to display non scaled defaults of mouse_wheel_scroll and top tabs margin configs.
2025-11-24Better out of box smoothness and responsiveness (#357)Jefferson González
* Better out of box smoothness and responsiveness This PR does various things to improve the out of the box editor smoothness which includes: * Adding new renwindow.get_refresh_rate method. * Introduce new config.auto_fps flag to match the fps to current display refresh rate. * Setting config.fps to match the display refresh rate by default. * Emit displaychanged event to keep refresh rate updated. * Allow smaller snap point on move_towards animation to reduce jittering. * Reduce scroll rate from 0.3 to 0.2 for smoother scroll transition. * Decrease garbage collection setpause to collect more often and in smaller sizes preventing big pauses, which should improve responsiveness. Other Changes: * Introduce new global DEFAULT_FPS to assist the settings gui when changing the config.auto_fps/fps flags. * Revert default context lines from 10 to 1. * Increase blink period from 0.8 seconds to 1.2 seconds which should be less distracting. * Adjust run loop no-draw wait time * Drop no longer necessary lower latency config * Minor adjustment to code comment Thanks to Amer for testing!
2025-11-17Fix contextmenu triggered on window manager resize (#356)Jefferson González
Prevents the issue by ensuring that no mod keys are set when listening for the on_mouse_pressed right click. Fixes #355, thanks to M4he for reporting!
2025-11-11emptyview: disable horizontal scrollbar (#351)Jefferson González
This PR disables the horizontal scrollbar since the emptyview/welcome screen is responsive.
2025-11-06luajit subproject: drop mcode patches (#350)Jefferson González
A LuaJIT code drop just happened and it fixes the mcode issue that was causing performance regressions on platforms like ARM64 due to code not properly jitting. This PR drops the patches previously used to circumvent the issue and re-adjusts the jitsetup code to drop the previous hack. Ref: https://github.com/LuaJIT/LuaJIT/issues/285
2025-10-31Fix Doc:Indent/Unindent commands that inserted/deleted a wrong amount of ↵Sentmoraap
whitespace (#343)
2025-08-28Prevent duplicate projects on core.add_project (#342)Jefferson González
This change prevents adding a project that is already loaded.
2025-08-28tokenizer: fix premature end of child subsyntaxes (#339)Jefferson González
When a child subsyntax was running from a parent subsyntax it was ended prematurely if an expression from parent subsyntax was found. One example is the python syntax file that has a subsyntax for [] and {} pairs. If a string inside of these pairs contained a ] or } the string subsyntax was prematurely ended. Example code: ```python HEALTH_CHECK_GLOBS = [ "*/_health{/,}", r"*/\[_health\]{/,}", "*/live{/,}", ] ```
2025-08-26clarify docs for ignored files and dir/files patterns (#337)AmerM137
2025-08-20Change window title to include current project (#336)Jefferson González
As discussed with Amer this PR does the following to the window title: * Show relative path of project files instead of absolute * Show project only on file views * Use previous path behaviour for non project files * Make the function in charge of generating the title of view public to allow for modifications.
2025-08-12Add config option for insensitive next word selection (#332)Jefferson González
As requested by Amer, this PR adds the ability to perform case insensitive next word selection on some find/replace commands. New config flag: ```lua ---Perform case insensitive next word selection. --- ---The default is false. ---@type boolean config.select_add_next_no_case = false ``` Applicable commands: * find-replace:select-add-next * find-replace:select-add-all
2025-08-10Reset previous project module settings on change (#329)Jefferson González
With this change a core:restart is performed when the main project is changed and the previous project had a custom project module loaded. Fixes #328
2025-08-05Remove wrong parameter on renderer.draw_rect ffijgmdev
2025-07-31SDL3 port (#254)Jefferson González
* Updates for SDL3 support Port of Pragtical to SDL3 using a cherry-picked commit from upstream with additional changes and adjustments from pragtical/pragtical#8 --------- Co-authored-by: Jan <sentrycraft123@gmail.com> Co-authored-by: takase1121 <20792268+takase1121@users.noreply.github.com> * replace memory functions with SDL equivalent --------- Co-authored-by: Jan <sentrycraft123@gmail.com> Co-authored-by: takase1121 <20792268+takase1121@users.noreply.github.com>
2025-07-31Add common.open_in_system(resource) function (#321)SDL2Jefferson González
* Add common.open_in_system(resource) function This functionality was fragmented thru the source code as in EmptyView, Settings and TreeView providing their own code to open links, files and directories using the system launcher. Also various plugins on the plugins repo provide their own way. With this PR they can be adapted to use this function instead of duplicating the functionality. Besides providing a built-in mechanism of opening resources with the operating system launcher, it also adds supports for other operating systems: * Amiga * Haiku * SerenityOS Also the function should provide a central location for supporting other systems if the need arises. * Changes to code with walkero-gr guidance Better handle AmigaOS since the Amiga port properly sets the PLATFORM variable, also, properly handle URL's and directories. On MorphOS the open command is available so use that.
2025-07-31Remove useless state assignment from token_iterjgmdev
2025-07-28docview: account for visible lines on scroll_to_make_visiblejgmdev
2025-07-25Move inner functions to outer on tokenizer.tokenize (#318)Jefferson González
This can increase tokenization performance up to 50% or 2x as shown on simple benchmark: Inner functions : 14.19575 sec (10000 iters) Outer functions : 7.27609 sec (10000 iters) This is specially true for LuaJIT where it is able to better apply optimizations when tokenizer.tokenize is been deeply called. As an example, running the tokenizer with inner functions inside an if else condition will yield worst performance (as in the numbers above) than when run on the global scope. Another benefit of moving the inner functions outside is a bit more of code clarity.
2025-07-24Revert back to performant iterator on each_token (#317)Jefferson González
Previously I added a feature to tokenizer.each_token where you can give it the starting offset, this is used to more rapidly calculate the x offset on the DocView. At that time I choose to use a coroutine.wrap for the convenience but little I did know about the performance difference between the previously used function iterator and the coroutine.wrap + yield strategy. In a small benchmark the difference of using the simpler outer iterator function results on a 23 times speed increment from the coroutine.wrap... so, this PR adapts the introduced starting offset logic to an outer iterator function just as before.
2025-07-23Built-in support for file and string comparisons (#306)Jefferson González
* Re-calculates differences on text insert or remove. * Draw differences on scrollbar and sync arrows in middle * Commands to navigate to next/prev change and to apply them on the contrary view * Plugin API for usage by other plugins like scm. * Main scrollbar always expanded and 3 times bigger * Added diff:start-files-comparison command * Added diff:start-strings-comparison command * Optionally log the amount of time that it took to compute the differences. * Added diff colors to default style * Added config for plain text rendering of changes
2025-07-21Add built-in config to toggle line numbers (#316)Jefferson González
Also adds a matching core:toggle-line-numbers command, and a graphical toggle on the settings interface,
2025-07-20doc:go-to-line: live syntax preview (#314)Jefferson González
As suggested by Amer, this implements live syntax preview when typing text on the doc:go-to-line command. This is done by introducing a `draw_text` flag to the command_view that accepts a function to perform custom text drawing.
2025-07-20Improve core.run() timings. (#313)Jefferson González
2025-07-18clamp to zero the top context lines scroll amountjgmdev
2025-07-18Add special highlight colors to search selections (#312)Jefferson González
* Add special highlight colors to search selections As noted by Amer and me included, most color schemes provide a highlight selection color that is hard to spot when performing search operations or selections as in this command`find-replace:select-add-all`. For this reason this PR introduces the concept of a document search selections. These search selections will be colored different than a typical selection to make it more easy to identify. By default they will use as background color the style.caret and for the text the style.background. Two new style elements will be used if available: * `style.search_selection` - background color of the selection * `style.search_selection_text` - foreground (text) color of selection When pressing the escape key (as with normal document selections) the search selections will be cleared out. * Adapted projectsearch to use add_search_selection * Added an `instant` param to DocView:scroll_to_make_visible. * Updated linewrapping plugin to respect the instant parameter on override. * Clear search selections on various docview events * Make search_ui scroll to result instant * Bonus: Add missing context line on bottom (as reported by Amer)