Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -55,17 +55,30 @@ command.add(nil, {
|
||||
end,
|
||||
|
||||
["core:find-file"] = function()
|
||||
local files = {}
|
||||
for _, item in pairs(core.project_files) do
|
||||
if item.type == "file" then
|
||||
table.insert(files, item.filename)
|
||||
end
|
||||
end
|
||||
core.command_view:enter("Open File From Project", function(text, item)
|
||||
text = item and item.text or text
|
||||
core.root_view:open_doc(core.open_doc(text))
|
||||
end, function(text)
|
||||
local files = {}
|
||||
for _, item in pairs(core.project_files) do
|
||||
if item.type == "file" then
|
||||
table.insert(files, item.filename)
|
||||
if text == "" then
|
||||
local recent_files = {}
|
||||
for i = 2, #core.visited_files do
|
||||
table.insert(recent_files, core.visited_files[i])
|
||||
end
|
||||
table.insert(recent_files, core.visited_files[1])
|
||||
local other_files = common.fuzzy_match(files, "")
|
||||
for i = 1, #other_files do
|
||||
table.insert(recent_files, other_files[i])
|
||||
end
|
||||
return recent_files
|
||||
else
|
||||
return common.fuzzy_match(files, text)
|
||||
end
|
||||
return common.fuzzy_match(files, text)
|
||||
end)
|
||||
end,
|
||||
|
||||
|
||||
@@ -26,6 +26,10 @@ end
|
||||
|
||||
local function insert_at_start_of_selected_lines(text, skip_empty)
|
||||
local line1, col1, line2, col2, swap = doc():get_selection(true)
|
||||
if line2 > line1 and col2 == 1 then
|
||||
line2 = line2 - 1
|
||||
col2 = #doc().lines[line2]
|
||||
end
|
||||
for line = line1, line2 do
|
||||
local line_text = doc().lines[line]
|
||||
if (not skip_empty or line_text:find("%S")) then
|
||||
|
||||
Reference in New Issue
Block a user