about summary refs log tree commit diff
path: root/pkgs/applications/editors/lite-xl
diff options
context:
space:
mode:
authorzachel <zach@zachel.io>2022-11-04 16:22:33 +0900
committerzachel <zach@zachel.io>2022-11-04 16:30:42 +0900
commit36a7a0097886daefc1de8a126a7480bd361928ed (patch)
treee93f5782af4ca6bff5aa84a4f036dd1b956d439b /pkgs/applications/editors/lite-xl
parent00d58bc626725419b58c0524823f015f73d9c0e1 (diff)
lite-xl: 2.0.5 -> 2.1.0
Diffstat (limited to 'pkgs/applications/editors/lite-xl')
-rw-r--r--pkgs/applications/editors/lite-xl/0001-replace-unpack-with-table-unpack.patch91
-rw-r--r--pkgs/applications/editors/lite-xl/default.nix13
2 files changed, 4 insertions, 100 deletions
diff --git a/pkgs/applications/editors/lite-xl/0001-replace-unpack-with-table-unpack.patch b/pkgs/applications/editors/lite-xl/0001-replace-unpack-with-table-unpack.patch
deleted file mode 100644
index e7a2287427f6e..0000000000000
--- a/pkgs/applications/editors/lite-xl/0001-replace-unpack-with-table-unpack.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-diff --git a/data/core/commands/findreplace.lua b/data/core/commands/findreplace.lua
-index 5d27aa6..db6a2dd 100644
---- a/data/core/commands/findreplace.lua
-+++ b/data/core/commands/findreplace.lua
-@@ -37,7 +37,7 @@ local function update_preview(sel, search_fn, text)
-     last_view:scroll_to_line(line2, true)
-     found_expression = true
-   else
--    last_view.doc:set_selection(unpack(sel))
-+    last_view.doc:set_selection(table.unpack(sel))
-     found_expression = false
-   end
- end
-@@ -55,7 +55,7 @@ end
- local function find(label, search_fn)
-   last_view, last_sel = core.active_view,
-     { core.active_view.doc:get_selection() }
--  local text = last_view.doc:get_text(unpack(last_sel))
-+  local text = last_view.doc:get_text(table.unpack(last_sel))
-   found_expression = false
- 
-   core.command_view:set_text(text, true)
-@@ -69,8 +69,8 @@ local function find(label, search_fn)
-       last_fn, last_text = search_fn, text
-     else
-       core.error("Couldn't find %q", text)
--      last_view.doc:set_selection(unpack(last_sel))
--      last_view:scroll_to_make_visible(unpack(last_sel))
-+      last_view.doc:set_selection(table.unpack(last_sel))
-+      last_view:scroll_to_make_visible(table.unpack(last_sel))
-     end
-   end, function(text)
-     update_preview(last_sel, search_fn, text)
-@@ -79,8 +79,8 @@ local function find(label, search_fn)
-   end, function(explicit)
-     core.status_view:remove_tooltip()
-     if explicit then
--      last_view.doc:set_selection(unpack(last_sel))
--      last_view:scroll_to_make_visible(unpack(last_sel))
-+      last_view.doc:set_selection(table.unpack(last_sel))
-+      last_view:scroll_to_make_visible(table.unpack(last_sel))
-     end
-   end)
- end
-diff --git a/data/core/doc/init.lua b/data/core/doc/init.lua
-index 2e72907..0e61ffb 100644
---- a/data/core/doc/init.lua
-+++ b/data/core/doc/init.lua
-@@ -198,9 +198,9 @@ local function selection_iterator(invariant, idx)
-   local target = invariant[3] and (idx*4 - 7) or (idx*4 + 1)
-   if target > #invariant[1] or target <= 0 or (type(invariant[3]) == "number" and invariant[3] ~= idx - 1) then return end
-   if invariant[2] then
--    return idx+(invariant[3] and -1 or 1), sort_positions(unpack(invariant[1], target, target+4))
-+    return idx+(invariant[3] and -1 or 1), sort_positions(table.unpack(invariant[1], target, target+4))
-   else
--    return idx+(invariant[3] and -1 or 1), unpack(invariant[1], target, target+4)
-+    return idx+(invariant[3] and -1 or 1), table.unpack(invariant[1], target, target+4)
-   end
- end
- 
-@@ -345,7 +345,7 @@ function Doc:raw_insert(line, col, text, undo_stack, time)
- 
-   -- push undo
-   local line2, col2 = self:position_offset(line, col, #text)
--  push_undo(undo_stack, time, "selection", unpack(self.selections))
-+  push_undo(undo_stack, time, "selection", table.unpack(self.selections))
-   push_undo(undo_stack, time, "remove", line, col, line2, col2)
- 
-   -- update highlighter and assure selection is in bounds
-@@ -357,7 +357,7 @@ end
- function Doc:raw_remove(line1, col1, line2, col2, undo_stack, time)
-   -- push undo
-   local text = self:get_text(line1, col1, line2, col2)
--  push_undo(undo_stack, time, "selection", unpack(self.selections))
-+  push_undo(undo_stack, time, "selection", table.unpack(self.selections))
-   push_undo(undo_stack, time, "insert", line1, col1, text)
- 
-   -- get line content before/after removed text
-diff --git a/data/core/tokenizer.lua b/data/core/tokenizer.lua
-index d95baeb..f77fed4 100644
---- a/data/core/tokenizer.lua
-+++ b/data/core/tokenizer.lua
-@@ -161,7 +161,7 @@ function tokenizer.tokenize(incoming_syntax, text, state)
-         if count % 2 == 0 then break end
-       end
-     until not res[1] or not close or not target[3]
--    return unpack(res)
-+    return table.unpack(res)
-   end
-   
-   while i <= #text do
diff --git a/pkgs/applications/editors/lite-xl/default.nix b/pkgs/applications/editors/lite-xl/default.nix
index b19c3f531b7aa..11dd387523774 100644
--- a/pkgs/applications/editors/lite-xl/default.nix
+++ b/pkgs/applications/editors/lite-xl/default.nix
@@ -3,7 +3,7 @@
 , Foundation
 , freetype
 , lib
-, lua5_2
+, lua5_4
 , meson
 , ninja
 , pcre2
@@ -15,26 +15,21 @@
 
 stdenv.mkDerivation rec {
   pname = "lite-xl";
-  version = "2.0.5";
+  version = "2.1.0";
 
   src = fetchFromGitHub {
     owner = "lite-xl";
     repo = "lite-xl";
     rev = "v${version}";
-    sha256 = "sha256-7ppO5ITijhJ37OL6xlQgu1SaQ/snXDH5xJOwuXZNUVA=";
+    sha256 = "sha256-9nQFdii6SY14Cul7Ki0DUEsu75HWTCeEZtXaU6KGRiM=";
   };
 
-  patches = [
-    # Fixes compatibility with Lua5.2, remove patch when a new release covers this
-    ./0001-replace-unpack-with-table-unpack.patch
-  ];
-
   nativeBuildInputs = [ meson ninja pkg-config ];
 
   buildInputs = [
     agg
     freetype
-    lua5_2
+    lua5_4
     pcre2
     reproc
     SDL2