diff --git a/src/kamp/cmd/edit.rs b/src/kamp/cmd/edit.rs index 326594b..039beba 100644 --- a/src/kamp/cmd/edit.rs +++ b/src/kamp/cmd/edit.rs @@ -4,6 +4,9 @@ use std::path::PathBuf; use super::{Context, Error, Result}; pub(crate) fn edit(ctx: Context, focus: bool, files: Vec) -> Result { + if focus && ctx.is_draft() { + return Err(anyhow::Error::msg("no client in context").into()); + } let mut buf = String::new(); let mut pair = [None; 2]; let mut coord = None; @@ -57,8 +60,6 @@ pub(crate) fn edit(ctx: Context, focus: bool, files: Vec) -> Result