Skip to content

Commit

Permalink
feat: added support for getting plugins locations for askForName proc…
Browse files Browse the repository at this point in the history
…edure

FossilOrigin-Name: ff667ef2ea5779751b414c986f0b205e6099ce3648b69c541182b302892a41fb
  • Loading branch information
thindil committed Jan 9, 2024
1 parent 7194619 commit 8dbb401
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/input.nim
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,9 @@ proc askForName*[T](db; action, namesType: string; name: var T) {.sideEffect,
elif names is seq[Completion]:
db.rawSelect(qry = "SELECT * FROM completions ORDER BY command ASC",
objs = names)
elif names is seq[Plugin]:
db.rawSelect(qry = "SELECT * FROM plugins ORDER BY id ASC",
objs = names)
{.ruleOn: "ifStatements".}
if names.len == 0:
showError(message = "There is no available " & namesType & " to show.", db = db)
Expand All @@ -366,6 +369,8 @@ proc askForName*[T](db; action, namesType: string; name: var T) {.sideEffect,
itemName = name.name
elif names is seq[Completion]:
itemName = name.command
elif names is seq[Plugin]:
itemName = name.location
{.ruleOn: "ifStatements".}
row[rowIndex] = style(ss = "[" & $(index + 1) & "] ", style = getColor(
db = db, name = ids)) & style(ss = itemName, style = getColor(
Expand Down

0 comments on commit 8dbb401

Please sign in to comment.