Add syncing
This commit is contained in:
@ -459,15 +459,21 @@ func NewTaskEdit(com *common.Common, task *taskwarrior.Task, isNew bool) *taskEd
|
||||
onSelect := func(item list.Item) tea.Cmd {
|
||||
return nil
|
||||
}
|
||||
onCreate := func(newProject string) tea.Cmd {
|
||||
// The new project name will be used as the project value
|
||||
// when the task is saved
|
||||
return nil
|
||||
}
|
||||
|
||||
opts := []picker.PickerOption{}
|
||||
opts := []picker.PickerOption{picker.WithOnCreate(onCreate)}
|
||||
if isNew {
|
||||
opts = append(opts, picker.WithFilterByDefault(true))
|
||||
} else {
|
||||
opts = append(opts, picker.WithDefaultValue(task.Project))
|
||||
}
|
||||
|
||||
projPicker := picker.New(com, "Project", itemProvider, onSelect, opts...)
|
||||
projPicker.SetSize(70, 8)
|
||||
projPicker.SelectItemByFilterValue(task.Project)
|
||||
projPicker.Blur()
|
||||
|
||||
defaultKeymap := huh.NewDefaultKeyMap()
|
||||
|
||||
Reference in New Issue
Block a user