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)
|
||||
|
||||
local new_range = Range.find_at_cursor(range.start_cursor)
|
||||
assert(new_range)
|
||||
new_range:hit_search(trace, 1):set_current()
|
||||
|
||||
return true
|
||||
@ -43,16 +44,13 @@ local function inspect()
|
||||
if range then
|
||||
local trace = range:hit_test(Cursor.get_current())
|
||||
assert(trace)
|
||||
print('--- range start ---')
|
||||
dump(trace)
|
||||
print('--- range stop ---')
|
||||
else
|
||||
print('no range found!')
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
inspect = inspect,
|
||||
reflow = reflow,
|
||||
setup = Options.setup,
|
||||
setup = Options.setup,
|
||||
query = Options.query,
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
local options_current = {
|
||||
default = {
|
||||
auto_reload = false,
|
||||
brace_last_indent = false,
|
||||
brace_last_wrap = true,
|
||||
brace_pad = false,
|
||||
|
@ -7,13 +7,19 @@ if not vim.g.argonaut_loaded then
|
||||
end
|
||||
end
|
||||
|
||||
local function argonaut_auto_reload()
|
||||
if require('argonaut').query('auto_reload') then
|
||||
argonaut_reload()
|
||||
end
|
||||
end
|
||||
|
||||
local function argonaut_reflow()
|
||||
argonaut_reload()
|
||||
argonaut_auto_reload()
|
||||
require('argonaut').reflow()
|
||||
end
|
||||
|
||||
local function argonaut_inspect()
|
||||
argonaut_reload()
|
||||
argonaut_auto_reload()
|
||||
require('argonaut').inspect()
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user