Commit Graph

84 Commits

Author SHA1 Message Date
Adam f85612e0f0
Fix Project Scanning (#746)
Removed dmon, and replaced with logic that works across Linux, Mac, FreeBSD and Windows. Have tested on all platforms, and seems to work.

Co-authored-by: Jan200101 <sentrycraft123@gmail.com>
2022-03-06 00:59:22 -05:00
jgmdev df0635ad35 Implemented system.get_process_id() 2022-02-03 22:20:42 -04:00
Francesco Abbate f6a0e12e31 Merge branch 'master-2.0' 2022-01-19 20:31:33 +01:00
Jan200101 192c577966
Add fallbacks to all common dependencies 2022-01-15 00:53:46 +01:00
Francesco Abbate ae1890d29a Fix project files reading with symlink 2022-01-12 00:32:10 +01:00
Francesco Abbate 44a8dc320b Fix some errors with previous commits 2022-01-09 23:26:11 +01:00
Francesco Abbate f0aea5b1a4 Report error codes from dmon_watch_add 2022-01-09 23:26:11 +01:00
Francesco Abbate 1520c12580 Remove DMON_LOG_ERROR to return an error code 2022-01-09 23:26:11 +01:00
Adam Harrison 31d448971a Restored floating point time granularity. 2022-01-08 12:59:15 -05:00
Jan200101 99ddf1fb92
Migrate to Lua 5.4 2021-12-31 13:53:01 +01:00
Francesco Abbate adaf023541 Always watch/unwatch subdirectories on all systems
Simplifies and uniformize the logic on the Lua side for the
setting of directories' watches. Now we always use the methods:

systems.watch_dir_add / rm

on all the project's directories at any depth when we are not
in files limit mode.

In files limited mode the functions systems.watch_dir_add/rm are
called only on the expanded folders. The shown_subdir table is also
updated only in files limited mode.

On the C side, using the dmon library, we remove the recursive argument
from the system.watch_dir and we always call it recursively except on
Linux. At the same time the functions:

systems.watch_dir_add / rm

are provided but as dummy functions that does nothing except on Linux
where they work as before to add / remove sub-directories in the inotify
watch.

In this was on the Lua side we always act we if the watches needed to be
set for each sub-directory explicitly, independently of the system.

The important improvement introduced is that we always avoid calling
dmon_watch recursively on Linux. This latter thing is problematic with
inotify and is therefore avoided on Linux.

On the other side we simplifies the logic on the Lua side and remove
conditions based on the OS used.
2021-12-30 15:25:27 +01:00
Guldoman a122d7e916
Correct `get_key_name` comment 2021-12-23 00:06:24 +01:00
Jipok 773a85cd2d Support for remaped special keys(Fix #757) 2021-12-22 02:22:34 +05: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
Adam Harrison cb13afd749 Changed operator to be more correct for utf8. 2021-12-18 15:11:50 -05:00
Adam Harrison b4384eb49d Added in @Jipok's comment. 2021-12-18 15:09:00 -05:00
Adam baf43084b6
Merge pull request #745 from Jipok/keycode_fix
Correct definition of the pressed key for different layouts and languages
2021-12-18 14:55:14 -05:00
Jipok a8f7e9a35e Correct definition of the pressed key for different layouts and languages 2021-12-19 00:24:28 +05:00
Adam Harrison eb9918089a Takes kivutar's changes into account, cleaning things up slightly. 2021-12-15 20:31:24 -05:00
Jipok c3b7234315 Keyboard layout independent shortcuts 2021-12-11 23:42:15 +05:00
Adam 8120654c59
Merge branch 'master' into plugin_api_h_fix 2021-12-05 22:11:47 -05:00
takase1121 aff1261b08
move NULL check to import side 2021-12-01 20:42:49 +08:00
Adam Harrison 96db380c73 Manual merge of into . 2021-11-23 15:57:22 -05:00
takase1121 b42f48782b
revert system.c
do not generate the exported symbols with the script
2021-11-17 08:58:44 +08:00
Adam Harrison 6750ddca2a Changed name of x1 and x2 to x and y. 2021-11-14 15:46:33 -05:00
Adam Harrison ce2ec9f442 Moved commands out to the outer event loop. 2021-11-14 15:41:28 -05:00
Adam Harrison 934f9c05d4 Screwed up checks. 2021-11-07 15:01:03 -05:00
Adam Harrison a184ec9cc3 Improved heuristic to pay more attention to string length. 2021-11-07 14:04:42 -05:00
takase1121 9003a9124a
refactor api_require function into a machine generated file 2021-11-06 19:24:12 +08: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
Francesco Abbate 911a3cee08 Report dmon modify events 2021-10-08 23:13:50 +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
Francesco Abbate 48475c70a0 Avoid unnecessary call to SDL_GetModState 2021-10-02 18:37:01 +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
takase1121 27fe185ed4
fix unable to load any native library
something went wrong in snprintf that it skips the first character of
the library name. Not only that, the signature is actually luaopen and
not lua_open.
2021-09-25 10:31:15 +08:00
Adam 8c32950f4b
Merge pull request #527 from adamharrison/native-interop
Native Plugins
2021-09-23 15:11:08 -04:00
Adam Harrison e13529444f Less C code, and more namespacing is better. 2021-09-20 23:42:39 -04:00
Adam Harrison c01c5a23b0 Added in plugin table. 2021-09-20 23:38:10 -04:00
Francesco Abbate 849614a3cb Avoid unnecessary call to SDL_GetModState 2021-09-19 18:42:36 +02:00
Francesco c018ca3c60
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-09-17 22:38:09 +02:00
Adam Harrison fbc11c00eb Split entrypoints in half. 2021-09-16 16:55:33 -04:00
Adam Harrison 801b7dd0d9 Added some comments. 2021-09-16 16:22:33 -04:00
Adam Harrison 03b467d9d9 Cleaned up, added utility API. 2021-09-16 16:08:21 -04:00
Adam Harrison 377ce1cd06 Moved things around, fixed a few things up. 2021-09-16 12:37:17 -04:00
Adam Harrison e9f48ce949 Added in sample plugin and tested things out. Works. 2021-09-14 00:13:30 -04:00
Adam Harrison a66a76f9c9 Added in searcher. 2021-09-13 23:40:01 -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
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