Merge remote-tracking branch 'origin/master' into subpixel-font-positioning-fix
This commit is contained in:
commit
6909fd9a60
|
@ -19,6 +19,7 @@ config.line_limit = 80
|
||||||
config.max_symbols = 4000
|
config.max_symbols = 4000
|
||||||
config.max_project_files = 2000
|
config.max_project_files = 2000
|
||||||
config.transitions = true
|
config.transitions = true
|
||||||
|
config.blink_period = 0.8
|
||||||
|
|
||||||
-- Disable plugin loading setting to false the config entry
|
-- Disable plugin loading setting to false the config entry
|
||||||
-- of the same name.
|
-- of the same name.
|
||||||
|
|
|
@ -47,8 +47,6 @@ DocView.translate = {
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
local blink_period = 0.8
|
|
||||||
|
|
||||||
|
|
||||||
function DocView:new(doc)
|
function DocView:new(doc)
|
||||||
DocView.super.new(self)
|
DocView.super.new(self)
|
||||||
|
@ -290,9 +288,9 @@ function DocView:update()
|
||||||
|
|
||||||
-- update blink timer
|
-- update blink timer
|
||||||
if self == core.active_view and not self.mouse_selecting then
|
if self == core.active_view and not self.mouse_selecting then
|
||||||
local n = blink_period / 2
|
local n = config.blink_period / 2
|
||||||
local prev = self.blink_timer
|
local prev = self.blink_timer
|
||||||
self.blink_timer = (self.blink_timer + 1 / config.fps) % blink_period
|
self.blink_timer = (self.blink_timer + 1 / config.fps) % config.blink_period
|
||||||
if (self.blink_timer > n) ~= (prev > n) then
|
if (self.blink_timer > n) ~= (prev > n) then
|
||||||
core.redraw = true
|
core.redraw = true
|
||||||
end
|
end
|
||||||
|
@ -344,7 +342,7 @@ function DocView:draw_line_body(idx, x, y)
|
||||||
|
|
||||||
-- draw caret if it overlaps this line
|
-- draw caret if it overlaps this line
|
||||||
if line == idx and core.active_view == self
|
if line == idx and core.active_view == self
|
||||||
and self.blink_timer < blink_period / 2
|
and self.blink_timer < config.blink_period / 2
|
||||||
and system.window_has_focus() then
|
and system.window_has_focus() then
|
||||||
local lh = self:get_line_height()
|
local lh = self:get_line_height()
|
||||||
local x1 = x + self:get_col_x_offset(line, col)
|
local x1 = x + self:get_col_x_offset(line, col)
|
||||||
|
|
|
@ -877,7 +877,7 @@ end
|
||||||
|
|
||||||
function core.on_error(err)
|
function core.on_error(err)
|
||||||
-- write error to file
|
-- write error to file
|
||||||
local fp = io.open(EXEDIR .. "/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))
|
||||||
fp:close()
|
fp:close()
|
||||||
|
|
|
@ -108,8 +108,8 @@ function StatusView:get_items()
|
||||||
local line, col = dv.doc:get_selection()
|
local line, col = dv.doc:get_selection()
|
||||||
local dirty = dv.doc:is_dirty()
|
local dirty = dv.doc:is_dirty()
|
||||||
local indent = dv.doc.indent_info
|
local indent = dv.doc.indent_info
|
||||||
local indent_label = indent.type == "hard" and "tabs: " or "spaces: "
|
local indent_label = (indent and indent.type == "hard") and "tabs: " or "spaces: "
|
||||||
local indent_size = tostring(indent.size) .. (indent.confirmed and "" or "*")
|
local indent_size = indent and tostring(indent.size) .. (indent.confirmed and "" or "*") or "unknown"
|
||||||
|
|
||||||
return {
|
return {
|
||||||
dirty and style.accent or style.text, style.icon_font, "f",
|
dirty and style.accent or style.text, style.icon_font, "f",
|
||||||
|
|
27
src/main.c
27
src/main.c
|
@ -63,11 +63,11 @@ static void init_window_icon(void) {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#define LITE_OS_HOME "USERPROFILE"
|
#define LITE_OS_HOME "USERPROFILE"
|
||||||
#define LITE_PATHSEP_PATTERN "\\\\"
|
#define LITE_PATHSEP_PATTERN "\\\\"
|
||||||
#define LITE_NONPATHSEP_PATTERN "[^\\\\]"
|
#define LITE_NONPATHSEP_PATTERN "[^\\\\]+"
|
||||||
#else
|
#else
|
||||||
#define LITE_OS_HOME "HOME"
|
#define LITE_OS_HOME "HOME"
|
||||||
#define LITE_PATHSEP_PATTERN "/"
|
#define LITE_PATHSEP_PATTERN "/"
|
||||||
#define LITE_NONPATHSEP_PATTERN "[^/]"
|
#define LITE_NONPATHSEP_PATTERN "[^/]+"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
@ -127,23 +127,28 @@ init_lua:
|
||||||
"local core\n"
|
"local core\n"
|
||||||
"xpcall(function()\n"
|
"xpcall(function()\n"
|
||||||
" HOME = os.getenv('" LITE_OS_HOME "')\n"
|
" HOME = os.getenv('" LITE_OS_HOME "')\n"
|
||||||
" local exedir = EXEFILE:match(\"^(.+)" LITE_PATHSEP_PATTERN LITE_NONPATHSEP_PATTERN "+$\")\n"
|
" local exedir = EXEFILE:match(\"^(.*)" LITE_PATHSEP_PATTERN LITE_NONPATHSEP_PATTERN "$\")\n"
|
||||||
" local prefix = exedir:match(\"^(.+)" LITE_PATHSEP_PATTERN "bin$\")\n"
|
" local prefix = exedir:match(\"^(.*)" LITE_PATHSEP_PATTERN "bin$\")\n"
|
||||||
" dofile((prefix and prefix .. '/share/lite-xl' or exedir .. '/data') .. '/core/start.lua')\n"
|
" dofile((prefix and prefix .. '/share/lite-xl' or exedir .. '/data') .. '/core/start.lua')\n"
|
||||||
" core = require('core')\n"
|
" core = require('core')\n"
|
||||||
" core.init()\n"
|
" core.init()\n"
|
||||||
" core.run()\n"
|
" core.run()\n"
|
||||||
"end, function(err)\n"
|
"end, function(err)\n"
|
||||||
" system.show_fatal_error('Lite XL start error', '"
|
" local error_dir\n"
|
||||||
"Fatal error: cannot locate the data directory.\\n"
|
" print('ERROR', err)\n"
|
||||||
"Please verify that the data folder is available.')\n"
|
|
||||||
" local fp = io.open((exedir and exedir .. '/' or '') .. 'error.txt', 'wb')\n"
|
|
||||||
" fp:write('Error: ' .. tostring(err) .. '\\n')\n"
|
|
||||||
" fp:write(debug.traceback(nil, 2) .. '\\n')\n"
|
|
||||||
" fp:close()\n"
|
|
||||||
" if core and core.on_error then\n"
|
" if core and core.on_error then\n"
|
||||||
|
" error_dir=USERDIR\n"
|
||||||
" pcall(core.on_error, err)\n"
|
" pcall(core.on_error, err)\n"
|
||||||
|
" else\n"
|
||||||
|
" error_dir=system.absolute_path('.')\n"
|
||||||
|
" local fp = io.open('error.txt', 'wb')\n"
|
||||||
|
" fp:write('Error: ' .. tostring(err) .. '\\n')\n"
|
||||||
|
" fp:write(debug.traceback(nil, 4))\n"
|
||||||
|
" fp:close()\n"
|
||||||
" end\n"
|
" end\n"
|
||||||
|
" system.show_fatal_error('Lite XL internal error',\n"
|
||||||
|
" 'An internal error occurred in a critical part of the application.\\n\\n'..\n"
|
||||||
|
" 'Please verify the file \\\"error.txt\\\" in the directory '..error_dir)\n"
|
||||||
" os.exit(1)\n"
|
" os.exit(1)\n"
|
||||||
"end)\n"
|
"end)\n"
|
||||||
"return core and core.restart_request\n";
|
"return core and core.restart_request\n";
|
||||||
|
|
Loading…
Reference in New Issue