Commit Graph

241 Commits

Author SHA1 Message Date
Francesco Abbate f18c6ac790 Merge branch 'master-2.0' into master-luajit-2.0 2021-12-20 15:58:15 +01:00
Francesco Abbate 3109263c5d Call dmon_unwatch when changing project
Fix a conspicuous omission to call the dmon_unwatch function
when changing project directory.

This uncovered a bug or a quirk of the dmon library where the watch_ids
can change as a result of calling dmon_unwatch because they are just
indexes on a contiguous array. Use a workaround to always unwatch the
first valid watch_id N times.
2021-12-20 14:42:48 +01:00
Francesco Abbate 20d2b8c21f Add missing file for lbitlib 2021-10-23 15:22:59 +02:00
Francesco Abbate 09a91d6d0b Fix luajit compatibility for new code
The more recent version of lite-xl use the bit32 library and
the lua_Buffer functions. These function were not implemented
by the minimal compatiblity layer and are now added with this commit.

The code is adapted from:

https://github.com/keplerproject/lua-compat-5.2
2021-10-23 15:22:59 +02:00
Francesco Abbate fa33768a55 Initial draft of transition to use LuaJIT2 instead of Lua 5.2
There is problem with utf8 expression matching on common.utf8_chars
2021-10-23 15:22:59 +02:00
Francesco 6f732f67f9
Merge pull request #612 from Guldoman/fix_regex
Fix regex in tokenizer
2021-10-22 21:44:44 +02:00
Francesco Abbate ddb6196e9e Force project rescan on network filesystems 2021-10-21 23:57:17 +02:00
Francesco Abbate 7bdfcd529e Add a function to detect filesystem type on linux 2021-10-21 23:24:38 +02:00
Guldoman 038e335c8c
Show error message when `pcre2_match` fails 2021-10-11 22:20:44 +02:00
Francesco Abbate 0f8d7f3202 Do no add rencache a command for empty rectangles 2021-10-10 14:58:51 +02:00
Francesco Abbate cb08c5cbb7 Fix dirty pixels problem on window's right side
The last column of pixel on the window's right side isn't correctly
drawn and pixels appear dirty and more noticeably when the a NagView
message was previously shown, a stripe of red pixels remains on the right.

We use now a more souding roundig scheme. Now the rectangles to clip or to
draw are passed around as Lua numbers without any rounding. In turns, when
the rect coordinates are passed to the renderer we ensure the border of the
rect are correctly snapped to the pixel's grid. It works by computing the
coordinates of the edges, round them to integers and then compute the rect's
width based on the rounded coordinates values.
2021-10-10 14:52:55 +02:00
Francesco Abbate 911a3cee08 Report dmon modify events 2021-10-08 23:13:50 +02:00
Francesco Abbate a9f6f01ed0 Move dmon files into lib/dmon 2021-10-08 22:10:17 +02:00
Francesco Abbate bba42adc73 Adopt new version of dmon 2021-10-08 21:55:43 +02:00
Francesco Abbate 9c43727ebc Implement directory monitoring using septag/dmon
Use a notification based directory monitoring based on the
septag/dmon lirbary instead of periodically rescan the whole
project's tree.
2021-10-08 21:31:22 +02:00
Jean-André Santoni 0b4d1e2bce Fix the size and blurriness of the icon on OSX (#553)
* Fix the size and blurriness of the icon on OSX

* Don't nest ifndef

* Fix
2021-10-02 18:39:22 +02:00
Adam 6aa316e3c3 Rearranged DPI calc so that on calc failure, returns 1. (#547) 2021-10-02 18:39:21 +02:00
Adam ed3ea35ed5 Potentially fixing issue with cache not invalidating on restart. (#548) 2021-10-02 18:39:21 +02:00
Adam Harrison 291616df3f Removed extra macros, used PLATFORM. Also removed MACOS, as it's redundant C code that's already encapsulated within PLATFORM. 2021-10-02 18:39:03 +02:00
Francesco Abbate 48475c70a0 Avoid unnecessary call to SDL_GetModState 2021-10-02 18:37:01 +02:00
Adam ab73f914ad Added in custom runtime environment variable for ease of testing. (#538) 2021-10-02 18:37:00 +02:00
Francesco 0ff0ee2c61 Fix numpad fn keys (#532)
* Fix the numeric keypad function keys

As suggested in:

https://github.com/lite-xl/lite-xl/issues/64

* Apply scancode lookup to KEY_UP events
2021-10-02 18:37:00 +02:00
Francesco Abbate c9669410ad Fix macOS build issue with recent commit
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-19 14:33:39 -07:00
Francesco Abbate 717f4eb782 Conditionally disable macos bundle function 2021-08-19 11:33:03 +02:00
Francesco Abbate d9e73a97ea Merge remote-tracking branch 'harens/macos-bundle' 2021-08-19 11:32:36 +02:00
Nikolai Sinyov 1687bbd92d
Update main.c
Fixed interface Scale in MacOS in get_scale function
2021-08-19 10:07:46 +03:00
harens 2d088256b1
Add unix-like behaviour on macOS
Closes https://github.com/lite-xl/lite-xl/issues/398
2021-08-18 13:26:51 +01:00
takase1121 35fd29fc39 remove extraneous DPI code
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-17 07:53:44 -07:00
redtide 3468164518 Updated Meson configuration
- 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-08-09 22:26:16 +02:00
Adam Harrison 0777a6f0b8 Merged dev to master. 2021-07-20 14:39:50 -04:00
takase1121 c7bbf221ee remove duplicated constants 2021-07-15 18:01:24 -04:00
takase1121 192a93014d change double quotes to single quotes to reduce escaping 2021-07-15 18:01:24 -04:00
takase1121 818e21610c do not terminate process when read fails 2021-07-15 18:01:24 -04:00
takase1121 de3013ce88 fix wrongly spaced variable name 2021-07-15 18:01:24 -04:00
takase1121 e7b025203b add generic read function
process_read and process_read_errors no longer contain redundant code
2021-07-15 18:01:24 -04:00
takase1121 8bbb26a469 refactor process.c
- include api.h instead of individual #includes
- moved metatable name to API_TYPE_PROCESS
- moved read buffer size to READ_BUF_SIZE
2021-07-15 18:01:24 -04:00
Adam 9126b5e64d
Merge pull request #313 from jgmdev/add-system-rmdir
Added `system.rmdir(path)`, and `common.rm(path, recursive)`
2021-06-29 17:44:58 -04:00
jgmdev 4188269cef Added system.rmdir(path)
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-28 11:07:27 -04:00
redtide df63775dca Use lite-xl as project and exacutable names 2021-06-25 22:54:02 +02:00
redtide 3f58e554ba Reorganization of data resources 2021-06-24 22:53:14 +02:00
Adam 83a604dfb7
Merge pull request #296 from lite-xl/font-copy-api
Add a C API copy method for font_desc objects
2021-06-24 12:47:16 -04:00
jgmdev 88704c6ecb [api/process] added missing fields and minor fix to pid() 2021-06-22 15:01:30 -04:00
Francesco Abbate 1cf0f2009c Add a C API copy method for font_desc objects
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-21 11:18:52 +02:00
jgmdev 5d2734de81 Merge reproc changes from dev. 2021-06-18 14:19:09 -04:00
lqdev 6195b246a5 ignore SIGPIPE from subprocesses spawned with reproc 2021-06-18 11:17:36 -04:00
Adam 804429e3b6
Merge pull request #266 from adamharrison/QuickOptimization
Replaced fill loop with SDL_FillRect.
2021-06-12 22:53:14 -04:00
Francesco Abbate 0f2ac136d0 Fix whitespace errors 2021-06-11 15:02:15 +02:00
Francesco Abbate 752ecd5ece Group mouse move events from C API function
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-11 15:00:18 +02:00
Adam Harrison 214e6898df Reverted if guard. 2021-06-09 19:34:02 -04:00
Adam Harrison aa9f16c74c Added in #if guard for ARM achitectures. 2021-06-09 18:05:39 -04:00