aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2021-08-19Fix macOS build issue with recent commitFrancesco Abbate
Add objc_args in meson when compiling to pass C defines also to bundle_open.m. Default "bundle" option to false to have by default a unix-like build and install. In the run-local script always expect that "bundle" option is to false to have a unix-like install. In the build-package script pass the -Dbundle=true option when building on macos. When setting the resouce path revert to original method using [[NSBundle mainBundle] resourcePath] to have the real resource path when the bundle option will be activated. With the recent commit the function set_macos_bundle_resources will be called only if the "bundle" option is activate and is not used in unix-like mode.
2021-08-19Conditionally disable macos bundle functionFrancesco Abbate
2021-08-19Merge remote-tracking branch 'harens/macos-bundle'Francesco Abbate
2021-08-19Update main.cNikolai Sinyov
Fixed interface Scale in MacOS in get_scale function
2021-08-18Add unix-like behaviour on macOSharens
Closes https://github.com/lite-xl/lite-xl/issues/398
2021-08-17remove extraneous DPI codetakase1121
since 5 months ago (ttps://github.com/libsdl-org/SDL/commit/c289bad9007cb672c994f726d967f6e5682f200d) SDL2 now reads Xft.dpi. There is no need to link to X11 anymore.
2021-08-09Updated Meson configurationredtide
- Added version and license metadata - Configuration data to be used in configured files to set metadata - Portable binary and directories in the main install directory - Binary file installed in correct places for all supported platforms - Freedesktop AppStream support - Added missing files install rules
2021-07-20Merged dev to master.Adam Harrison
2021-07-15remove duplicated constantstakase1121
2021-07-15change double quotes to single quotes to reduce escapingtakase1121
2021-07-15do not terminate process when read failstakase1121
2021-07-15fix wrongly spaced variable nametakase1121
2021-07-15add generic read functiontakase1121
process_read and process_read_errors no longer contain redundant code
2021-07-15refactor process.ctakase1121
- include api.h instead of individual #includes - moved metatable name to API_TYPE_PROCESS - moved read buffer size to READ_BUF_SIZE
2021-06-29Merge pull request #313 from jgmdev/add-system-rmdirAdam
Added `system.rmdir(path)`, and `common.rm(path, recursive)`
2021-06-28Added system.rmdir(path)jgmdev
It is reported that the built-in lua function os.remove(path) does not removes empty directories on windows. To fix this a system.rmdir function is introduced that calls a native win32 function. Also common.rm(path, recursively) was added which wraps system.rmdir() to easily delete an entire folder with all its contents.
2021-06-25Use lite-xl as project and exacutable namesredtide
2021-06-24Reorganization of data resourcesredtide
2021-06-24Merge pull request #296 from lite-xl/font-copy-apiAdam
Add a C API copy method for font_desc objects
2021-06-22[api/process] added missing fields and minor fix to pid()jgmdev
2021-06-21Add a C API copy method for font_desc objectsFrancesco Abbate
Add a renderer.font's method "copy" to clone the font object by specifying an optional new size. In the size is not given the size of the original object is used. Should fulfill the request from issue #288.
2021-06-18Merge reproc changes from dev.jgmdev
2021-06-18ignore SIGPIPE from subprocesses spawned with reproclqdev
2021-06-12Merge pull request #266 from adamharrison/QuickOptimizationAdam
Replaced fill loop with SDL_FillRect.
2021-06-11Fix whitespace errorsFrancesco Abbate
2021-06-11Group mouse move events from C API functionFrancesco Abbate
Groups together consecutive mouse move events like done in core.step() lua function but on the C side. It does not introduce any meaningful speedup but it theory is more efficient and simplifies the Lua code. The simplification of the Lua code alone is enough to justify this change?
2021-06-09Reverted if guard.Adam Harrison
2021-06-09Added in #if guard for ARM achitectures.Adam Harrison
2021-06-08Replaced fill loop with SDL_FillRect.Adam Harrison
2021-06-04Changed regex error handling, so that errors can be handled gracefully in ↵Adam Harrison
lua, and made it so gsub returns the exact matches and replacements.
2021-06-03Scale fonts context menu (#246)Francesco
* Retrieve scale plugin from lite-plugins * New implementation of scale plugin and font C API Introduce two new C API functions, renderer.font.get_size and set_size respectively to get the font size and to set the size to a new value. Using these functions we don't need to know the name of the font but we can just change their size. Adapt the scale plugin to use the new C API function with minor adaptations in the logic. Use smaller step to scale fonts. Rename font_desc_free function, previous name was misleading as only the cached resources are freed. * Add contextmenu plugin from takase From https://github.com/takase1121/lite-contextmenu Adapted to show font scaling commands and find/replace commands. i# testing.lua * Fix the cursor flickering with contextmenu To avoid flickering of the cursor when using the context menu we add a new function `core.request_cursor` that just take note of the cursor requested. The cursor will be actually changed only in root_view:draw() method only when all the drawing operations are done. This means the cursor will be changed only once per frame and only the most recent cursor change request will take effect. * Remove unneeded scale plugin return functions
2021-06-03Flush the SDL_QUIT event when Cmd+W is detected in SDL_KEYDOWN as well (#248)Ferdinand Prantl
On macos 11.2.3 with sdl 2.0.14 the keyup handler for cmd+w was not enough. Maybe the quit event started to be triggered from the keydown handler? In any case, flushing the quit event there too helped.
2021-06-03Enable lite-xl to be started from a symlink to the deployed binary (#249)Ferdinand Prantl
Use resolved executablePath instead of resourcePath to allow lanching the lite-xl binary via a symlink, like typically done by Homebrew: /usr/local/bin/lite-xl -> /Applications/lite-xl.app/Contents/MacOS/lite-xl The resourcePath returns /usr/local in this case instead of /Applications/lite-xl.app/Contents/Resources, which makes later access to the resource files fail. Resolving the symlink to the executable and then the relative path to the expected directory Resources is a workaround for starting the application from both the launcher directly and the command line via the symlink.
2021-06-02Add PCRE to support regular expressionsAdam
Use regular expressions instead of Lua patterns for find and replace editor commands. Syntax files can now use regex or Lua patterns as before keeping backward compatibility for plugins.
2021-05-21Fix crash problem with rencache and font accessFrancesco Abbate
In some cases rencache was using a FontDesc pointer that was actually freed by Lua giving segfaults errors. In addition, some FontDesc object were not freed in some cases if the rencache_end_frame was not called when performing the "restart" command. The invalid access problem can happen because rencache keep some pointers to FontDesc object but these are Lua userdata that Lua can dispose of. This situation is prone to hard errors and we should avoid to keep pointers to objects managed by Lua. To this purpose we use luaL_ref/unref to bind the FontDesc into the Lua's registry while rencache need them. We still keeps pointer to FontDesc object but using luaL_ref we are assured they will not be disposed by Lua. Since we are using luaL_ref/unref to inform the GC about when the objects are in use we can now finalize the objects directly when Lua collects them. Previously the GC metamethods was issuing a FREE command to rencache and the font was actually freed only from the rencache_end_frame function.
2021-05-16Allowed for optional boolean to better match filenames. (#180)Adam
2021-05-06More accurate update rects / show window / present sequencev1.16.8Francesco Abbate
For the option when we use the SDL_Renderer we change: - the order of calls to SDL_DestroyTexture/Renderer. Reported by valgrind on linux as an error to destroy the renderer before the texture. - the SDL_Renderer and texture are created when the surface is initialized before the window is shown It seems that creating the SDL_Renderer and Texture between the moment the window was shown and the renderer present was introducing a flashing blank window because of the time taken to create the renderer/texture resources.
2021-05-05Ensure the rencache commands buffer is cleared on restartFrancesco Abbate
Fix issue #176 but it should be tested more thoroughly.
2021-04-29Make usage of SDL renderer optionalFrancesco Abbate
2021-04-27Fix missing scaling for update rects in rendererv1.16.6-sdl-renderer-2Francesco Abbate
2021-04-27Update the whole texture with RenderCopyFrancesco Abbate
2021-04-27Alternative texture update schemeFrancesco Abbate
2021-04-27Add assert if font loading fails during renderingFrancesco Abbate
2021-04-27Ensure we update only modified rectsFrancesco Abbate
2021-04-26Cleanup FontDesc struct and implementationFrancesco Abbate
2021-04-26First implementation of scaling for retina displayFrancesco Abbate
Introduce a new approach that discriminate coordinates in points and pixels. Now all the logic from the Lua side and in rencache is to always use points. The coordinates are converted to pixels only within the renderer, in the file renderer.c. In this way the application logic does not need to care about the scaling of the retina displays. For non-retina display the scaling between points and pixels is equal to one so nothing will change. There is nevertheless a change that leak into the Lua side. The subpixel coordinates are in sub-pixel, not sub-points so they are scaled by the retina scaling factor. But no change in the code is required because the subpixel scaling factor take into account the retina scaling, when present. Because the retina scaling factor is not know when the application starts but only when a window is actually available we introduce a mechanism to render the font with a given scaling factor only from the renderer when they are needed. We use therefore FontDesc to describe the font information but without actually rasterizing the font at a given scale.
2021-04-23Fix error with missing ren_resize callv1.16.6-sdl-renderer-1Francesco Abbate
2021-04-23First working implementionFrancesco Abbate
Cleanup also debug messages
2021-04-23WIP: testing usage of SDL rendererFrancesco Abbate
It does segfault.
2021-04-21Add momentum scroll for macosFrancesco Abbate
Taken from @mathewmariani lite-macos