Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lua/csgithub/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ M.search = function(args)

local query = require("csgithub.query")
local q = query.construct_query(merged_args)
if q == nil then
return nil
end
local url = query.construct_url(q)

return url
Expand Down
6 changes: 5 additions & 1 deletion lua/csgithub/query.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ end
M.construct_query = function(args)
local query_parts = {}

local query_text = M.construct_query_text()
if query_text == "" then
return nil
end
-- path:
if args.includeFilename or args.includeExtension then
local path = M.construct_query_path(args)
Expand All @@ -51,7 +55,7 @@ M.construct_query = function(args)
end

-- text
table.insert(query_parts, M.construct_query_text())
table.insert(query_parts, query_text)

return table.concat(query_parts, " ")
end
Expand Down