diff options
author | Christopher Arndt <chris@chrisarndt.de> | 2021-12-24 19:46:55 +0100 |
---|---|---|
committer | Christopher Arndt <chris@chrisarndt.de> | 2021-12-24 19:46:55 +0100 |
commit | 4365480f9112f18043233c42ec099e6bb9c96db4 (patch) | |
tree | 2b1ce41fd632feb1b30db68019557e9722a7ad3d /plugins/sort.lua | |
parent | b0d4156cf163c3b6b1e3a646be56f0d5b01096de (diff) | |
download | lite-xl-plugins-4365480f9112f18043233c42ec099e6bb9c96db4.tar.gz lite-xl-plugins-4365480f9112f18043233c42ec099e6bb9c96db4.zip |
fix: [sort] func passed to Doc:replace must have two return values
Caused error `/usr/share/lite-xl/core/doc/init.lua:443: attempt to perform arithmetic on a nil value at /usr/share/lite-xl/core/init.lua:1114` when using `sort:sort`
Signed-off-by: Christopher Arndt <chris@chrisarndt.de>
Diffstat (limited to 'plugins/sort.lua')
-rw-r--r-- | plugins/sort.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/sort.lua b/plugins/sort.lua index fd9d044..6c65149 100644 --- a/plugins/sort.lua +++ b/plugins/sort.lua @@ -24,7 +24,7 @@ command.add("core.docview", { local head, body, foot = text:match("(\n*)(.-)(\n*)$") local lines = split_lines(body) table.sort(lines, function(a, b) return a:lower() < b:lower() end) - return head .. table.concat(lines, "\n") .. foot + return head .. table.concat(lines, "\n") .. foot, 1 end) end, }) |