Auto reloader
This commit is contained in:
parent
655663cb6f
commit
3d3f9bfcdf
@ -33,6 +33,7 @@ local function reflow()
|
|||||||
builder:output(range.start_cursor.row, range.stop_cursor.row)
|
builder:output(range.start_cursor.row, range.stop_cursor.row)
|
||||||
|
|
||||||
local new_range = Range.find_at_cursor(range.start_cursor)
|
local new_range = Range.find_at_cursor(range.start_cursor)
|
||||||
|
assert(new_range)
|
||||||
new_range:hit_search(trace, 1):set_current()
|
new_range:hit_search(trace, 1):set_current()
|
||||||
|
|
||||||
return true
|
return true
|
||||||
@ -43,16 +44,13 @@ local function inspect()
|
|||||||
if range then
|
if range then
|
||||||
local trace = range:hit_test(Cursor.get_current())
|
local trace = range:hit_test(Cursor.get_current())
|
||||||
assert(trace)
|
assert(trace)
|
||||||
print('--- range start ---')
|
|
||||||
dump(trace)
|
dump(trace)
|
||||||
print('--- range stop ---')
|
|
||||||
else
|
|
||||||
print('no range found!')
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
inspect = inspect,
|
inspect = inspect,
|
||||||
reflow = reflow,
|
reflow = reflow,
|
||||||
setup = Options.setup,
|
setup = Options.setup,
|
||||||
|
query = Options.query,
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
local options_current = {
|
local options_current = {
|
||||||
default = {
|
default = {
|
||||||
|
auto_reload = false,
|
||||||
brace_last_indent = false,
|
brace_last_indent = false,
|
||||||
brace_last_wrap = true,
|
brace_last_wrap = true,
|
||||||
brace_pad = false,
|
brace_pad = false,
|
||||||
|
@ -7,13 +7,19 @@ if not vim.g.argonaut_loaded then
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function argonaut_auto_reload()
|
||||||
|
if require('argonaut').query('auto_reload') then
|
||||||
|
argonaut_reload()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local function argonaut_reflow()
|
local function argonaut_reflow()
|
||||||
argonaut_reload()
|
argonaut_auto_reload()
|
||||||
require('argonaut').reflow()
|
require('argonaut').reflow()
|
||||||
end
|
end
|
||||||
|
|
||||||
local function argonaut_inspect()
|
local function argonaut_inspect()
|
||||||
argonaut_reload()
|
argonaut_auto_reload()
|
||||||
require('argonaut').inspect()
|
require('argonaut').inspect()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user