Commit Graph
100 Commits
Author SHA1 Message Date
Takase 1952848caa fix(process): check for HANDLE_INVALID (#1475) 2023-08-19 12:44:19 +08:00
Takase 2fe1f52a1f Process API improvements (again) (#1370)
* feat(process): add push_error
* refactor(process): use push_error for better errors
* style(process): consistent error messages
* refactor(process): reimplement process.strerror() with push_error
* refactor(process): implement close_fd only once
* refactor(process): rename process_handle to process_handle_t
* fix(process): prevent errors from a NULL error message
* refactor(process): refactor push_error into 2 functions
* fix(process): fix wrong error message
* fix(process): check if push_error_string actually pushed something
* refactor(process): make error messages descriptive
* fix(process): check for empty table instead of aborting
* refactor(process): make error messages descriptive on Windows
* refactor(process): rename process_stream_handle to process_stream_t
* refactor(process): fix wrong usage of process_handle_t
* fix(process): fix wrong type name
* refactor(process): incoporate kill_list_thread into process_kill_list_t
* refactor(process): make kill_list per-state data
2023-08-19 12:43:57 +08:00
Takase 64a6d88618 Build releases with Ubuntu 18.04 container (#1460)
* ci(release): try using lite-xl-build-box

* ci(build): test with my own fork

* ci(build): do not install python via actions

* ci(build): disable package updates

* fix(scripts/appimage.sh): add workaround for non-FUSE environments

* ci(build): document why the actions are disabled

* ci(release): fix typo
2023-08-19 12:43:56 +08:00
Takase 8e57b71118 refactor(plugin_api): move the header into include/ (#1440) 2023-08-19 12:43:09 +08:00
Takase a44a7eafe8 Cross compiling improvements + macOS universal binary (#1458)
* chore(resources): rename macos_arm64.txt to macos-arm64.txt
   This matches the platform-arch convention like many other parts of the project.
* chore(resources/cross): rename wasm.txt to unknown-wasm32.txt
* refactor(scripts/common.sh): use parameter expansion instead of if else
* feat(scripts/common.sh): support custom arch and platform for get_default_build_dir
* feat(scripts/build.sh): add --cross-platform, --cross-arch and --cross-file
* feat(scripts/package.sh): add --cross-platform and --cross-arch
* feat(build-packages.sh): add support for new options in build.sh and packages.sh
* ci(build): make arm64 binaries in CI
* ci(build): do not install external libraries
* ci(build): fix invalid artifact name
* ci(build): fix INSTALL_NAME
* ci(build): change name for macos artifacts
* ci(build): add script to build universal dmgs from individual dmgs
* ci(build): build universal dmgs
* fix(make-universal-binaries): fix wrong path for hdiutil
* ci(build): rename macos action
* fix(make-universal-binaries.sh): fix wrong pathname for ditto
* ci(release): build macos universal binaries
* ci(release): remove useless variables
* ci(release): fix wrong dependency
* ci(build): fix old ubuntu version
   This version will be restored once I complete some container-specific fixes.
* ci(build): make build_macos_universal depend on release
* ci(build): fix wrong dmg dir
* style(ci): capitalize 'universal' for CI name
* fix(make-universal-binaries.sh): fix truncated dmg name when it contains dots
* ci: styling changes
* ci(release): install appdmg only
2023-08-19 12:42:31 +08:00
Takase 1fe90da664 upgrade header files to Lua 5.4 (#1436)
* refactor(native_api_header): upgrade header files to Lua 5.4.

Almost all of the symbols in this file was from 5.2. This will obviously
not work because some function signatures have changed and some have
completely wrong return values, etc.
This commit updates the header files to Lua 5.4 based on the source code
and changes a few things.

* refactor(plugin_api): move the header into include/

* fix(lite_xl_plugin_api.h): include stdlib to avoid errors with exit

* refactor(lite_xl_plugin_api.h): do not return in SYMBOL_WRAP_CALL

* fix(lite_xl_plugin_api.h): fix wrong way of passing varargs

* fix(lite_xl_plugin_api.h): fix differing lua_rawlen definition

* fix(lite_xl_plugin_api.h): fix fallback function signature

* fix(lite_xl_plugin_api.h): fix conversion from void * to function pointer
2023-08-19 12:42:31 +08:00
Takase fdd6ca3426 Update api_require to expose more symbols (#1437)
* feat(system): update api_require for more symbols
* fix(system): fix missing 5.1 symbols
* fix(system): add more missing symbols
* fix(system): add all symbols
   We got'em this time. I swear.
* fix(system): fix undefined symbols due to conditional compilation
   There is only pain and suffering.
   Turns out some of the symbols are only exported when the options are enabled.
   We need to preprocess the header.
2023-08-19 12:41:56 +08:00
Takase 84aeea61c2 Optimizing MSYS2 CI (#1435)
* feat(ci): install dependencies on setup
* fix(ci): don't update msys2 when setup
* fix(ci): download subprojects before patching
* doc(ci): document why meson subprojects download is called
2023-08-19 12:41:56 +08:00
Takase a0c8f01312 fix(CI): bump dependency versions (#1434)
* refactor(ci): use microsoft/setup-msbuild
* fix(ci): fix wrong option name for setup-msbuild
* fix(ci): bump setup-python version
* fix(lua-utf8-patch): enable support for windows vista and above
* fix(ci): use vs backend
* fix(ci): reconfigure project manually after patch
* fix(ci): add a separate build step
* fix(ci): use msvc-dev-cmd again
2023-08-19 12:41:56 +08:00
Takase 4e3d6824ff fix: fix differing stacktrace on stdout and file (#1404)
* fix(c-bootstrap): produce identical stack traces
2023-08-19 12:41:55 +08:00
Takase bb31a1adf2 fix(windows-utf8-patch): fix os.getenv() not supporting UTF-8 output (#1397) 2023-08-19 12:40:43 +08:00
Takase a24432941c Fix invalid EXEFILE and EXEDIR on Windows (#1396)
* fix(main): fix get_exe_filename returning invalid result on Windows
* fix(main): fix bootstrap not intepreting UTF-8 properly
2023-08-19 12:40:34 +08:00
TakaseandGuldoman 84c7bb9de6 Asynchronous process reaping (#1412)
* refactor(process): introduce process_stream_handle separate from process_handle

* feat(process): introduce process_handle helper functions

* feat(process): add asynchronous process reaping

* feat(process): wait for shorter period if possible

* style(process): remove unecessary brackets

* style(process): fix parentheses

* refactor(process): remove useless setvbuf call

* style(process): remove unecessary value

* refactor(process): add size field into kill_list

* refactor(process): use SDL_Delay for sleeping

* style(process): remove trailing whitespace

* fix(main): destroy window before closing lua

* fix(process): check for timeout correctly

* refactor(process): remove unecessary if check

* refactor(process): remove size from the list

* fix(process): fix invalid delay calculation

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>

---------

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
2023-08-19 12:38:49 +08:00
Takase 32860c111e refactor(main): move SetProcessDPIAware to manifests (#1413) 2023-08-19 12:38:35 +08:00
Takase f685293417 Add manifest on Windows (#1405)
* fix(gitignore): add exclusion for manifest files

* feat(windows): add application manifest

* feat(build): use application manifest on windows

* refactor(build): use genrate_file to generate the manifest

* style(manifest): remove trailing whitespace
2023-08-19 12:38:34 +08:00
Takase b95fdfcf5f fix: exec() error not returned to parent (#1363)
* fix: exec() error not returned to parent

* chore: remove accidental lua.h inclusion
2023-08-19 12:37:20 +08:00
takase1121andvqn 218ba3ebac Context menu fixes and keyboard navigation (#1338)
* fix Doc contextmenu not registering commands if scale plugin is not found
* fix TreeView contextmenu commands not working if the mouse hovers DocView
* add keyboard navigation to TreeView contextmenu
* fix incorrect contextmenu predicate

Co-Authored-By: vqn <85911372+vqns@users.noreply.github.com>
2023-08-19 12:36:39 +08:00
Takase 2d0ddc302f Reorganize resources/ + wasm target (#1244)
* add README.md to resources directory
* add cross/ directory for meson cross files
* fix readme list syntax error
* fix reflink
* disable ASYNCIFY_ADVISE by default
* use executable names instead of hardcoding paths
2023-08-19 12:28:21 +08:00
Takase 69ce580970 do not allow users to create an empty font group (#1303) 2023-08-19 12:28:18 +08:00
TakaseandGitHub 6d0e7f3046 Fix some syntax errors (#1243)
* move signal.h inclusion outside of if-else block
not sure if this change is appropriate, we need to make sure SIG_IGN
is only set on POSIX targets. To verify this we might need to include
unistd.h,

* fix syntax error
this is often overlooked when compiling for normal platforms
2022-12-20 18:11:05 -04:00
TakaseandGitHub 2e186a746d better error messages for checkcolor (#1211) 2022-11-30 01:38:35 -04:00
TakaseandGitHub 718791857b update documentation for system (#1210) 2022-11-23 23:38:06 -04:00
TakaseandGitHub 7fa51bb7ab Windows font loading hotfix (#1205)
* add missing windows header
* hold the handle until GC so that the file can't be modified in use,
   this is a regression when we switched to CreateFile.
* set wpath to NULL to avoid double free
2022-11-17 01:09:38 -04:00
TakaseandGitHub 4107b0c3fe MSVC Support (#1199)
* fix stdalign and min/max for MSVC
* add missing ISREG and ISDIR for MSVC
* use MAX_PATH instead of PATH_MAX
* remove unecessary headers inclusion
* add MSVC CI
* add appropriate macros to platform detection
* re-add msvc CI artifacts
* upload the generated artifacts
* patch lua for MSVC CI builds
* update patch for MSVC compatibility
2022-11-15 23:23:45 -04:00
takase1121 69938c619c add support for loading fonts with UTF-8 filenames 2022-11-14 22:01:24 +08:00
takase1121 4457f26502 use flexible structure member from C99 2022-11-14 22:00:40 +08:00
takase1121 5cabc68ccb fix utfconv.h duplicate functions 2022-11-14 21:59:32 +08:00
TakaseandGitHub 437b954595 make the default core.ignore_files more specific (#1160)
* make the default core.ignore_files more specific

instead of blanket ignoring all dotfiles, we define a list of folders
and files to ignore. this makes the overall experience better.

* fix wrong path pattern

* add ignore_files to user init
2022-10-19 22:23:01 -04:00
TakaseandGitHub 7107f88f9f save a reference to the font when calling renderer.draw_text. (#1156)
This prevents the GC from killing it.
2022-10-13 22:52:38 -04:00
TakaseandGitHub 34c4ac3cd5 add parameter validation to checkcolor and f_font_group (#1145) 2022-10-10 11:44:19 -04:00
TakaseandGitHub 3409929a0c draw lite-xl icon in TitleView (#1143)
the original hamburger menu icon is confusing. It is not a menu
and clicking it doesn't do anything. There is no reason why
we can't draw lite-xl's icon in place of that.
2022-10-10 11:05:30 -04:00
TakaseandGitHub 4e1ce07610 make system.* functions support UTF8 filenames (#1042)
* make system.* functions support UTF8 filenames
* move utfconv.h into ifdef guard
* fix wrong null check
2022-06-17 09:31:52 -04:00
takase1121 bccc02743a add option to patch lua with UTF8 support 2022-06-16 13:35:38 +08:00
takase1121 7ecc174094 fix memory leak and wrong check in font_retrieve 2022-06-15 23:23:13 +08:00
takase1121 42e0028f1c run GC between scale to prevent ram from exploding 2022-06-15 22:56:52 +08:00
takase1121 0de90d542b omit filename from error message 2022-06-15 16:05:20 +08:00
takase1121 093ae837ee add .cache to gitignore 2022-06-15 16:04:37 +08:00
takase1121 73cd768a19 load space metrics only instead of all metrics of the 1st 256 characters 2022-06-12 08:22:01 +08:00
takase1121 dc2e9621ca lua patch for utf-8 support 2022-06-11 21:01:12 +08:00
takase1121 3bd679da12 make lite-xl respect the taskbar and allow aero-drop in borderless mode 2022-05-23 13:10:11 +08:00
takase1121andjgmdev d5da711b6f add selections in treeview 2022-03-18 03:11:13 -04:00
takase1121 f24ebf853d fix invalid memory access 2022-01-22 23:30:48 +08:00
takase1121 fc809b3172 comment the entire line when using block comment 2022-01-08 18:45:38 +08:00
takase1121 087314aea4 fix lhelper script 2022-01-07 17:31:24 +08:00
takase1121 df0f6fb94c make set_selections consistent 2022-01-02 19:18:08 +08:00
takase1121 e079ddfa37 refactor toggle-block-comments, make command spaces aware, set selections correctly 2022-01-02 19:14:03 +08:00
takase1121 33f7fe4fda toggle comment for whole line if nothing is selected 2021-12-26 15:12:28 +08:00
takase1121 69a857bbbf fallback to toggle-line-comment and vice versa if needed 2021-12-26 15:05:27 +08:00
takase1121 4d31b1bc40 add toggle-block-comment 2021-12-25 12:57:00 +08:00
takase1121 16df6d8bce add option for initial size 2021-12-24 21:32:28 +08:00
takase1121 84a3906323 fix FontGroup __gc method 2021-12-24 15:04:52 +08:00
takase1121 00e2e281d3 remove unsaved flag from log.txt 2021-12-22 10:54:25 +08:00
takase1121 2f65d5a26f make the date field consistent 2021-12-22 10:53:53 +08:00
takase1121 8f06ef9b81 ensure date is rendered properly 2021-12-22 10:50:35 +08:00
takase1121 54f6579e9d change INFO to use style.text 2021-12-21 17:38:25 +08:00
takase1121 3e175f5ad5 Merge branch 'master' of github.com:lite-xl/lite-xl into better-logview 2021-12-21 17:37:19 +08:00
takase1121 8d7867d118 adapt style.good and style.error 2021-12-21 17:36:32 +08:00
TakaseandGitHub f2ff32d5a7 Merge pull request #583 from takase1121/process-docs-update
update process API docs
2021-12-20 20:06:18 +08:00
takase1121 695c7bf781 add instruction when logview is open 2021-12-19 09:36:43 +08:00
takase1121 1526cd176c move selection logic to mouse click 2021-12-19 09:36:24 +08:00
takase1121 becdb99222 center icons to accomodate for size difference 2021-12-18 22:42:33 +08:00
takase1121 31df408d93 make timestamp fix sized 2021-12-18 20:11:50 +08:00
takase1121 fd3b4334ce add clipping to drawing log items 2021-12-18 20:11:24 +08:00
takase1121 b5dff196f6 make error icon red 2021-12-18 20:10:25 +08:00
takase1121 ab4ecd515b multiple improvements to logging
- added style.log table
- removed contextmenu
- use ctrl+click to copy individual log entries
- use icon instead of + or - for log items in logview
2021-12-18 10:51:44 +08:00
takase1121 d307c57d05 update header 2021-12-01 20:44:17 +08:00
takase1121 aff1261b08 move NULL check to import side 2021-12-01 20:42:49 +08:00
TakaseandGitHub d7c309d8e2 Merge branch 'master' into lineguide-config 2021-11-17 11:59:59 +08:00
takase1121 b42f48782b revert system.c
do not generate the exported symbols with the script
2021-11-17 08:58:44 +08:00
TakaseandGitHub 8e6f594790 Merge branch 'master' into replace-unpack 2021-11-17 08:42:08 +08:00
takase1121 6d36f2684a add polyfill for table.pack and table.unpack 2021-11-17 08:37:37 +08:00
TakaseandGitHub 285ea4f495 Merge branch 'master' into keymap-improvements 2021-11-15 21:59:04 +08:00
TakaseandGitHub 2033b67dae make labeler recursive
this is mentioned by Jan in Discord.
2021-11-10 08:12:27 +08:00
TakaseandGitHub d22bf520ed Keymap generator (#503)
add keymap generator
2021-11-08 12:44:09 +08:00
takase1121 68eb6810d9 update headers 2021-11-08 12:18:13 +08:00
takase1121 b26ffb4731 add warning if the symbol cannot be exported 2021-11-08 12:17:50 +08:00
takase1121 8bcc2d20f4 stylistic changes
removes comment from luaconf.h
add comment to signify filename
2021-11-08 12:17:26 +08:00
takase1121 e785bbf1bf update generated headers 2021-11-06 20:39:10 +08:00
takase1121 ad58f8898f make some stylistic changes
self printing isn't really needed now the script is in scripts/.
This will also fix a gcc warning
2021-11-06 20:36:33 +08:00
takase1121 d0a54227d8 update generated headers 2021-11-06 20:25:20 +08:00
takase1121 ac50404337 print luaconf.h into the output 2021-11-06 20:24:40 +08:00
takase1121 3982a8b31c fix possible nested comment 2021-11-06 20:24:17 +08:00
takase1121 acab4e3b26 support ignoring certain symbols 2021-11-06 20:20:36 +08:00
takase1121 9003a9124a refactor api_require function into a machine generated file 2021-11-06 19:24:12 +08:00
takase1121 a9d7ddc6e1 add support for export and import symbols
adds a lot of improvement to the script
- proper CLI
- generate a api_require.h which contains a function that export the symbols
2021-11-06 19:22:55 +08:00
takase1121 46f9bcb90c fix lite_xl_plugin_api.h
This fixes a longstanding bug with the plugin API.
This commit is not complete, further polish is still needed.
2021-11-05 22:42:52 +08:00
TakaseandGitHub b128d8b4c4 update process API docs
- add more description to each option
- add disclaimer that process.REDIRECT_DEFAULT should no longer be used
2021-10-04 12:32:48 +08: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
takase1121andFrancesco 7a24dbb17e revert new keyboard bindings 2021-09-09 07:44:58 +02:00
takase1121andFrancesco 1a21c66353 add autocomplete:cycle
Some (probably lots) of people are used to tabbing through autocomplete.
now, tab is binded to autocomplete:cycle while enter is binded to
autocomplete:complete.
2021-09-09 07:44:58 +02:00
takase1121 5cc23348a1 reverse the order of args in keymap.unbind 2021-09-08 23:17:50 +08:00
takase1121 7e4236a82f add keymap.unbind(), update contextmenu to use keymap.get_binding()
This is something probably people are looking for...
2021-09-08 23:11:36 +08:00
TakaseandFrancesco Abbate fb907c9bf4 increase code readibility 2021-09-07 14:59:03 +02:00
takase1121andFrancesco Abbate 97493a1a4e add doc:get_selection_text() 2021-09-07 14:59:03 +02:00
takase1121andFrancesco Abbate 30d3751632 remove unused variable 2021-09-07 14:59:03 +02:00
takase1121andFrancesco Abbate 14565b5226 more changes to logview
- remove draw_text_elipsis
- remove clip rect operations
- fix text drawing when expanded
- simplify code
2021-09-07 14:59:03 +02:00
takase1121andFrancesco Abbate e25ea1196a add context menu options for logview 2021-09-07 14:59:03 +02:00
takase1121andFrancesco Abbate 622b162225 add core.get_log() 2021-09-07 14:59:03 +02:00
takase1121andFrancesco Abbate afaf0a718d improve logview
The logview is now less cluttered.
The filename and stack trace (if any) is hidden by default.
The user can click on the log entry to expand it.
2021-09-07 14:59:03 +02:00
takase1121 30ccde896d replace unpack() with table.unpack()
I have no idea unpack() is still used and how it still worked.
2021-08-29 09:14:12 +08:00