| Age | Commit message (Collapse) | Author |
|
Previous flags been use were causing trace flushes, these ones
seem to work better after several benchmarks.
|
|
* 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
|
|
Keeps the image scale at 1 when its width doesn't exceeds the
ImageView width and the scale mode is set to "fit".
|
|
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.
|
|
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).
|
|
|
|
|
|
|
|
|
|
|
|
* 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
|
|
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" }
```
|
|
|
|
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.
|
|
* 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
|
|
Fixed small bug with saving workspaces on project change.
|
|
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.
|
|
|
|
* Resolved type-complaints that are detected by LuaLS
* Respond to feedback on PR
|
|
* 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>
|
|
generally lead to erroneous instantaneous returns.
|
|
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>
|
|
Fixes the issue described on #359 by performing the rounding
of the coords given to renderer.draw_text from Lua side.
|
|
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.
|
|
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.
|
|
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.
|
|
* 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!
|
|
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!
|
|
This PR disables the horizontal scrollbar since the
emptyview/welcome screen is responsive.
|
|
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
|
|
whitespace (#343)
|
|
This change prevents adding a project that is already loaded.
|
|
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{/,}",
]
```
|
|
|
|
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.
|
|
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
|
|
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
|
|
|
|
* 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>
|
|
* 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.
|
|
|
|
|
|
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.
|
|
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.
|
|
* 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
|
|
Also adds a matching core:toggle-line-numbers command,
and a graphical toggle on the settings interface,
|
|
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.
|
|
|
|
|
|
* 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)
|