summaryrefslogtreecommitdiffhomepage
path: root/packages/app/src/pages/session/session-command-helpers.ts
blob: b71a7b768834d632de06d2ec75eb2d361c231f5a (plain)
1
2
3
4
5
6
7
8
9
10
export const canAddSelectionContext = (input: {
  active?: string
  pathFromTab: (tab: string) => string | undefined
  selectedLines: (path: string) => unknown
}) => {
  if (!input.active) return false
  const path = input.pathFromTab(input.active)
  if (!path) return false
  return input.selectedLines(path) != null
}