Merge remote-tracking branch 'origin/master' into subpixel-font-positioning-fix

This commit is contained in:
Francesco Abbate 2021-03-07 12:25:53 +01:00
commit baf5aebe1c
3 changed files with 17 additions and 5 deletions

View File

@ -879,7 +879,7 @@ function core.on_error(err)
-- write error to file -- write error to file
local fp = io.open(USERDIR .. "/error.txt", "wb") local fp = io.open(USERDIR .. "/error.txt", "wb")
fp:write("Error: " .. tostring(err) .. "\n") fp:write("Error: " .. tostring(err) .. "\n")
fp:write(debug.traceback(nil, 4)) fp:write(debug.traceback(nil, 4) .. "\n")
fp:close() fp:close()
-- save copy of all unsaved documents -- save copy of all unsaved documents
for _, doc in ipairs(core.docs) do for _, doc in ipairs(core.docs) do

View File

@ -21,7 +21,7 @@ while [[ "$#" -gt 0 ]]; do
;; ;;
-plugin=*) -plugin=*)
# should be like -plugin=franko/lite-plugins/master/plugins/autowrap.lua # should be like -plugin=franko/lite-plugins/master/plugins/autowrap.lua
plugins+=("$(github_raw_content "${1#-plugin=}")") plugins+=("${1#-plugin=}")
;; ;;
-global) -global)
option_global=on option_global=on
@ -91,9 +91,20 @@ run_lite () {
fi fi
} }
github_raw_content () {
echo "https://raw.githubusercontent.com/$1"
}
fetch_plugins () { fetch_plugins () {
for name in "$@"; do for name in "$@"; do
curl --insecure -L "$name" -o "$datadir/plugins/${name##*/}" local url="$(github_raw_content "$name")"
local modname="${url##*/}"
if [ "$modname" == init.lua ]; then
local m1="${name#*/}"
modname="${m1%%/*}.lua"
fi
echo "installed $name as $modname from $url"
curl --insecure -L "$url" -o "$datadir/plugins/${modname}"
done done
} }

View File

@ -135,7 +135,8 @@ init_lua:
" core.run()\n" " core.run()\n"
"end, function(err)\n" "end, function(err)\n"
" local error_dir\n" " local error_dir\n"
" print('ERROR', err)\n" " io.stdout:write('Error: '..tostring(err)..'\\n')\n"
" io.stdout:write(debug.traceback(nil, 4)..'\\n')\n"
" if core and core.on_error then\n" " if core and core.on_error then\n"
" error_dir=USERDIR\n" " error_dir=USERDIR\n"
" pcall(core.on_error, err)\n" " pcall(core.on_error, err)\n"
@ -143,7 +144,7 @@ init_lua:
" error_dir=system.absolute_path('.')\n" " error_dir=system.absolute_path('.')\n"
" local fp = io.open('error.txt', 'wb')\n" " local fp = io.open('error.txt', 'wb')\n"
" fp:write('Error: ' .. tostring(err) .. '\\n')\n" " fp:write('Error: ' .. tostring(err) .. '\\n')\n"
" fp:write(debug.traceback(nil, 4))\n" " fp:write(debug.traceback(nil, 4)..'\\n')\n"
" fp:close()\n" " fp:close()\n"
" end\n" " end\n"
" system.show_fatal_error('Lite XL internal error',\n" " system.show_fatal_error('Lite XL internal error',\n"