mirror of
https://github.com/daylinmorgan/tsm.git
synced 2024-12-22 13:10:43 -06:00
feat: add back open flag support
This commit is contained in:
parent
947847459d
commit
81f7e0b4a8
3 changed files with 6 additions and 5 deletions
|
@ -30,7 +30,8 @@ proc findProjects*(open: bool = false): seq[Project] =
|
||||||
for devDir in tsmDirs.split(":"):
|
for devDir in tsmDirs.split(":"):
|
||||||
for d in walkDir(devDir):
|
for d in walkDir(devDir):
|
||||||
let p = newProject(d.path, tmux.sessions)
|
let p = newProject(d.path, tmux.sessions)
|
||||||
if open and p.open: result.add p
|
if open:
|
||||||
|
if p.open: result.add p
|
||||||
else:
|
else:
|
||||||
result.add p
|
result.add p
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,9 @@ import std/[tables]
|
||||||
|
|
||||||
import tui, project, utils
|
import tui, project, utils
|
||||||
|
|
||||||
proc tsm() =
|
proc tsm(open: bool = false) =
|
||||||
let
|
let
|
||||||
project = selectProject()
|
project = selectProject(open)
|
||||||
selected = project.name
|
selected = project.name
|
||||||
|
|
||||||
if selected notin tmux.sessions:
|
if selected notin tmux.sessions:
|
||||||
|
|
|
@ -42,7 +42,6 @@ type
|
||||||
# TODO: don't need top level projects
|
# TODO: don't need top level projects
|
||||||
# let (_, projects) = findProjects()
|
# let (_, projects) = findProjects()
|
||||||
var state = State()
|
var state = State()
|
||||||
state.projects = findProjects()
|
|
||||||
|
|
||||||
proc values(c: Coord): (int, int, int, int) = (c.x1, c.x2, c.y1, c.y2)
|
proc values(c: Coord): (int, int, int, int) = (c.x1, c.x2, c.y1, c.y2)
|
||||||
|
|
||||||
|
@ -219,8 +218,9 @@ proc newWindow(): Window =
|
||||||
state.cursor.update(min = result.coord.y1+3, max = result.coord.y2-1)
|
state.cursor.update(min = result.coord.y1+3, max = result.coord.y2-1)
|
||||||
result.tooSmall = (result.width < 15 or result.height < 10)
|
result.tooSmall = (result.width < 15 or result.height < 10)
|
||||||
|
|
||||||
proc selectProject*(): Project =
|
proc selectProject*(open: bool = false): Project =
|
||||||
|
|
||||||
|
state.projects = findProjects(open)
|
||||||
illwillInit(fullscreen = true)
|
illwillInit(fullscreen = true)
|
||||||
setControlCHook(quitProc)
|
setControlCHook(quitProc)
|
||||||
hideCursor()
|
hideCursor()
|
||||||
|
|
Loading…
Reference in a new issue