From b7631ba44ae0aec1e5efe9b6a6cc68d71b07e4d7 Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Wed, 15 Dec 2021 16:50:38 -0500 Subject: [PATCH 01/10] Added in restart keymapping. --- data/core/keymap-macos.lua | 1 + data/core/keymap.lua | 1 + 2 files changed, 2 insertions(+) diff --git a/data/core/keymap-macos.lua b/data/core/keymap-macos.lua index b0bd41a5..edbd53ef 100644 --- a/data/core/keymap-macos.lua +++ b/data/core/keymap-macos.lua @@ -6,6 +6,7 @@ local function keymap_macos(keymap) ["cmd+n"] = "core:new-doc", ["cmd+shift+c"] = "core:change-project-folder", ["cmd+shift+o"] = "core:open-project-folder", + ["cmd+shift+r"] = "core:restart", ["cmd+ctrl+return"] = "core:toggle-fullscreen", ["cmd+ctrl+shift+j"] = "root:split-left", diff --git a/data/core/keymap.lua b/data/core/keymap.lua index b076629b..404cff39 100644 --- a/data/core/keymap.lua +++ b/data/core/keymap.lua @@ -146,6 +146,7 @@ keymap.add_direct { ["ctrl+n"] = "core:new-doc", ["ctrl+shift+c"] = "core:change-project-folder", ["ctrl+shift+o"] = "core:open-project-folder", + ["ctrl+shift+r"] = "core:restart", ["alt+return"] = "core:toggle-fullscreen", ["f11"] = "core:toggle-fullscreen", From eb9918089a744621fedd1629f87191007f3c7e91 Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Wed, 15 Dec 2021 20:31:24 -0500 Subject: [PATCH 02/10] Takes kivutar's changes into account, cleaning things up slightly. --- src/api/renderer.c | 4 ++-- src/api/system.c | 4 ++-- src/bundle_open.m | 2 +- src/rencache.c | 1 + 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/api/renderer.c b/src/api/renderer.c index ad3e763f..bd001cdf 100644 --- a/src/api/renderer.c +++ b/src/api/renderer.c @@ -1,6 +1,6 @@ #include "api.h" -#include "renderer.h" -#include "rencache.h" +#include "../renderer.h" +#include "../rencache.h" static int f_font_load(lua_State *L) { const char *filename = luaL_checkstring(L, 1); diff --git a/src/api/system.c b/src/api/system.c index 013b9568..4f7de281 100644 --- a/src/api/system.c +++ b/src/api/system.c @@ -6,8 +6,8 @@ #include #include #include "api.h" -#include "dirmonitor.h" -#include "rencache.h" +#include "../dirmonitor.h" +#include "../rencache.h" #ifdef _WIN32 #include #include diff --git a/src/bundle_open.m b/src/bundle_open.m index 2ba10da7..fe27818b 100644 --- a/src/bundle_open.m +++ b/src/bundle_open.m @@ -1,5 +1,5 @@ #import -#include "lua.h" +#include #ifdef MACOS_USE_BUNDLE void set_macos_bundle_resources(lua_State *L) diff --git a/src/rencache.c b/src/rencache.c index e9339ecb..5d464226 100644 --- a/src/rencache.c +++ b/src/rencache.c @@ -1,6 +1,7 @@ #include #include #include +#include #include #include From a8f7e9a35efd2d8d10e90180298127bc26af28fc Mon Sep 17 00:00:00 2001 From: Jipok Date: Sun, 19 Dec 2021 00:24:28 +0500 Subject: [PATCH 03/10] Correct definition of the pressed key for different layouts and languages --- src/api/system.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/api/system.c b/src/api/system.c index 013b9568..aff932f8 100644 --- a/src/api/system.c +++ b/src/api/system.c @@ -106,7 +106,10 @@ static const char *get_key_name(const SDL_Event *e, char *buf) { !(e->key.keysym.mod & KMOD_NUM)) { return numpad[scancode - SDL_SCANCODE_KP_1]; } else { - strcpy(buf, SDL_GetScancodeName(e->key.keysym.scancode)); + if (e->key.keysym.sym <= 128) + strcpy(buf, SDL_GetKeyName(e->key.keysym.sym)); + else + strcpy(buf, SDL_GetScancodeName(scancode)); str_tolower(buf); return buf; } From b4384eb49d8a57eaded6989eb795e8098a323a52 Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Sat, 18 Dec 2021 15:09:00 -0500 Subject: [PATCH 04/10] Added in @Jipok's comment. --- src/api/system.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/api/system.c b/src/api/system.c index b2438589..cff28ace 100644 --- a/src/api/system.c +++ b/src/api/system.c @@ -106,6 +106,11 @@ static const char *get_key_name(const SDL_Event *e, char *buf) { !(e->key.keysym.mod & KMOD_NUM)) { return numpad[scancode - SDL_SCANCODE_KP_1]; } else { + /* We need to correctly handle non-standard layouts such as dvorak. + Therefore, if a Latin letter(code<128) is pressed in the current layout, + then we transmit it as it is. But we also need to support shortcuts in + other languages, so for non-Latin characters we pass the scancode that + matches the letter in the QWERTY layout. */ if (e->key.keysym.sym <= 128) strcpy(buf, SDL_GetKeyName(e->key.keysym.sym)); else From cb13afd7490ee738b9ea17dbfbda75edf922fea6 Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Sat, 18 Dec 2021 15:11:50 -0500 Subject: [PATCH 05/10] Changed operator to be more correct for utf8. --- src/api/system.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/system.c b/src/api/system.c index cff28ace..cbddd5f9 100644 --- a/src/api/system.c +++ b/src/api/system.c @@ -111,7 +111,7 @@ static const char *get_key_name(const SDL_Event *e, char *buf) { then we transmit it as it is. But we also need to support shortcuts in other languages, so for non-Latin characters we pass the scancode that matches the letter in the QWERTY layout. */ - if (e->key.keysym.sym <= 128) + if (e->key.keysym.sym < 128) strcpy(buf, SDL_GetKeyName(e->key.keysym.sym)); else strcpy(buf, SDL_GetScancodeName(scancode)); From 443177cc1c03367dbe007cc0927537f73d22e972 Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Sat, 18 Dec 2021 15:42:57 -0500 Subject: [PATCH 06/10] Cleaned up links. --- README.md | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index e6cd18dc..364d6235 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ since 1.16.7 release, it supports **retina displays** on macOS. Please note that Lite XL is compatible with lite for most plugins and all color themes. We provide a separate lite-plugins repository for Lite XL, because in some cases some adaptations may be needed to make them work better with Lite XL. -The repository with modified plugins is https://github.com/franko/lite-plugins. +The repository with modified plugins is https://github.com/lite-xl/lite-xl-plugins. The changes and differences between Lite XL and rxi/lite are listed in the [changelog]. @@ -131,10 +131,7 @@ rm -rf $HOME/.local/share/icons/hicolor/scalable/apps/lite-xl.svg \ ## Contributing Any additional functionality that can be added through a plugin should be done -as a plugin, after which a pull request to the [plugins repository] can be made. - -If the plugin uses any Lite XL-specific functionality, -please open a pull request to the [Lite XL plugins repository]. +as a plugin, after which a pull request to the [Lite XL plugins repository] can be made. Pull requests to improve or modify the editor itself are welcome. @@ -150,13 +147,13 @@ See the [licenses] file for details on licenses used by the required dependencie [Discord Badge Image]: https://img.shields.io/discord/847122429742809208?label=discord&logo=discord [screenshot-dark]: https://user-images.githubusercontent.com/433545/111063905-66943980-84b1-11eb-9040-3876f1133b20.png [lite]: https://github.com/rxi/lite -[website]: https://lite-xl.github.io -[build]: https://lite-xl.github.io/en/documentation/build/ -[Get Lite XL]: https://github.com/franko/lite-xl/releases/latest -[Get plugins]: https://github.com/franko/lite-plugins +[website]: https://lite-xl.com +[build]: https://lite-xl.com/en/documentation/build/ +[Get Lite XL]: https://github.com/lite-xl/lite-xl/releases/latest +[Get plugins]: https://github.com/lite-xl/lite-xl-plugins [Get color themes]: https://github.com/rxi/lite-colors -[changelog]: https://github.com/franko/lite-xl/blob/master/changelog.md -[Lite XL plugins repository]: https://github.com/franko/lite-plugins +[changelog]: https://github.com/lite-xl/lite-xl/blob/master/changelog.md +[Lite XL plugins repository]: https://github.com/lite-xl/lite-plugins [plugins repository]: https://github.com/rxi/lite-plugins [colors repository]: https://github.com/rxi/lite-colors [LICENSE]: LICENSE From 9cf795dabfb0d2cbb338ec881f55c607393e2408 Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Sat, 18 Dec 2021 15:43:44 -0500 Subject: [PATCH 07/10] Forgot a line or two. --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 364d6235..35de5f4e 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Lite XL has support for high DPI display on Windows and Linux and, since 1.16.7 release, it supports **retina displays** on macOS. Please note that Lite XL is compatible with lite for most plugins and all color themes. -We provide a separate lite-plugins repository for Lite XL, because in some cases +We provide a separate lite-xl-plugins repository for Lite XL, because in some cases some adaptations may be needed to make them work better with Lite XL. The repository with modified plugins is https://github.com/lite-xl/lite-xl-plugins. @@ -153,8 +153,7 @@ See the [licenses] file for details on licenses used by the required dependencie [Get plugins]: https://github.com/lite-xl/lite-xl-plugins [Get color themes]: https://github.com/rxi/lite-colors [changelog]: https://github.com/lite-xl/lite-xl/blob/master/changelog.md -[Lite XL plugins repository]: https://github.com/lite-xl/lite-plugins -[plugins repository]: https://github.com/rxi/lite-plugins +[Lite XL plugins repository]: https://github.com/lite-xl/lite-xl-plugins [colors repository]: https://github.com/rxi/lite-colors [LICENSE]: LICENSE [licenses]: licenses/licenses.md From 4d5d3e25654e36da8a8fbcec329e290cb2c87f8e Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 18 Dec 2021 22:37:33 -0500 Subject: [PATCH 08/10] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 35de5f4e..b54c17e4 100644 --- a/README.md +++ b/README.md @@ -151,9 +151,9 @@ See the [licenses] file for details on licenses used by the required dependencie [build]: https://lite-xl.com/en/documentation/build/ [Get Lite XL]: https://github.com/lite-xl/lite-xl/releases/latest [Get plugins]: https://github.com/lite-xl/lite-xl-plugins -[Get color themes]: https://github.com/rxi/lite-colors +[Get color themes]: https://github.com/lite-xl/lite-xl-colors [changelog]: https://github.com/lite-xl/lite-xl/blob/master/changelog.md [Lite XL plugins repository]: https://github.com/lite-xl/lite-xl-plugins -[colors repository]: https://github.com/rxi/lite-colors +[colors repository]: https://github.com/lite-xl/lite-xl-colors [LICENSE]: LICENSE [licenses]: licenses/licenses.md From 4cf9d859865fabdd0d1509adf4f8aa0a2cd039be Mon Sep 17 00:00:00 2001 From: Guldoman Date: Sun, 19 Dec 2021 18:12:34 +0100 Subject: [PATCH 09/10] Use new color themes repo --- scripts/package.sh | 12 ++++++------ scripts/repackage.sh | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/package.sh b/scripts/package.sh index 21a8cc91..c90e5b7c 100644 --- a/scripts/package.sh +++ b/scripts/package.sh @@ -20,7 +20,7 @@ show_help() { echo "-h --help Show this help and exit." echo "-p --prefix PREFIX Install directory prefix. Default: '/'." echo "-v --version VERSION Sets the version on the package name." - echo " --addons Install 3rd party addons (currently RXI colors)." + echo " --addons Install 3rd party addons (currently Lite XL colors)." echo " --debug Debug this script." echo "-A --appimage Create an AppImage (Linux only)." echo "-B --binary Create a normal / portable package or macOS bundle," @@ -45,13 +45,13 @@ install_addons() { # Copy third party color themes curl --insecure \ - -L "https://github.com/rxi/lite-colors/archive/master.zip" \ - -o "${build_dir}/rxi-lite-colors.zip" + -L "https://github.com/lite-xl/lite-xl-colors/archive/master.zip" \ + -o "${build_dir}/lite-xl-colors.zip" mkdir -p "${build_dir}/third/data/colors" - unzip "${build_dir}/rxi-lite-colors.zip" -d "${build_dir}" - mv "${build_dir}/lite-colors-master/colors" "${build_dir}/third/data" - rm -rf "${build_dir}/lite-colors-master" + unzip "${build_dir}/lite-xl-colors.zip" -d "${build_dir}" + mv "${build_dir}/lite-xl-colors-master/colors" "${build_dir}/third/data" + rm -rf "${build_dir}/lite-xl-colors-master" for module_name in colors; do cp -r "${build_dir}/third/data/$module_name" "${data_dir}" diff --git a/scripts/repackage.sh b/scripts/repackage.sh index f8da579f..3e0b5bfb 100644 --- a/scripts/repackage.sh +++ b/scripts/repackage.sh @@ -15,12 +15,12 @@ copy_directory_from_repo () { lite_copy_third_party_modules () { local build="$1" - curl --retry 5 --retry-delay 3 --insecure -L "https://github.com/rxi/lite-colors/archive/master.zip" -o "$build/rxi-lite-colors.zip" || exit 1 + curl --retry 5 --retry-delay 3 --insecure -L "https://github.com/lite-xl/lite-xl-colors/archive/master.zip" -o "$build/lite-xl-colors.zip" || exit 1 mkdir -p "$build/third/data/colors" "$build/third/data/plugins" - unzip -qq "$build/rxi-lite-colors.zip" -d "$build" - mv "$build/lite-colors-master/colors" "$build/third/data" - rm -fr "$build/lite-colors-master" - rm "$build/rxi-lite-colors.zip" + unzip -qq "$build/lite-xl-colors.zip" -d "$build" + mv "$build/lite-xl-colors-master/colors" "$build/third/data" + rm -fr "$build/lite-xl-colors-master" + rm "$build/lite-xl-colors.zip" } lite_branch=master From 2e9619f630d44b5de8f3646022f296b0ef258367 Mon Sep 17 00:00:00 2001 From: Guldoman Date: Sun, 19 Dec 2021 18:13:19 +0100 Subject: [PATCH 10/10] Directly link to our repo --- data/core/init.lua | 4 ++-- scripts/repackage.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data/core/init.lua b/data/core/init.lua index aadccc66..ea340c7a 100644 --- a/data/core/init.lua +++ b/data/core/init.lua @@ -183,7 +183,7 @@ local function show_max_files_warning(dir) "Filesystem is too slow: project files will not be indexed." or "Too many files in project directory: stopped reading at ".. config.max_project_files.." files. For more information see ".. - "usage.md at github.com/franko/lite-xl." + "usage.md at github.com/lite-xl/lite-xl." core.status_view:show_message("!", style.accent, message) end @@ -737,7 +737,7 @@ function core.init() "Refused Plugins", string.format( "Some plugins are not loaded due to version mismatch.\n\n%s.\n\n" .. - "Please download a recent version from https://github.com/franko/lite-plugins.", + "Please download a recent version from https://github.com/lite-xl/lite-xl-plugins.", table.concat(msg, ".\n\n")), opt, function(item) if item.text == "Exit" then os.exit(1) end diff --git a/scripts/repackage.sh b/scripts/repackage.sh index 3e0b5bfb..80af45c8 100644 --- a/scripts/repackage.sh +++ b/scripts/repackage.sh @@ -47,7 +47,7 @@ workdir=".repackage" rm -fr "$workdir" && mkdir "$workdir" && pushd "$workdir" fetch_packages_from_github () { - assets=($($wget -q -nv -O- https://api.github.com/repos/franko/lite-xl/releases/latest | grep "browser_download_url" | cut -d '"' -f 4)) + assets=($($wget -q -nv -O- https://api.github.com/repos/lite-xl/lite-xl/releases/latest | grep "browser_download_url" | cut -d '"' -f 4)) for url in "${assets[@]}"; do echo "getting: $url"