diff options
Diffstat (limited to 'src/config')
| -rw-r--r-- | src/config/mod.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/config/mod.rs b/src/config/mod.rs index 6b99483..cbf1020 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -11,7 +11,7 @@ use crate::client::{ Model, OpenAIClient, SendData, }; use crate::render::{MarkdownRender, RenderOptions}; -use crate::utils::{get_env_name, light_theme_from_colorfgbg, now, render_prompt}; +use crate::utils::{get_env_name, light_theme_from_colorfgbg, now, render_prompt, set_text}; use anyhow::{anyhow, bail, Context, Result}; use inquire::{Confirm, Select, Text}; @@ -247,6 +247,12 @@ impl Config { .with_context(|| "Failed to save message") } + pub fn maybe_copy(&self, text: &str) { + if self.auto_copy { + let _ = set_text(text); + } + } + pub fn config_file() -> Result<PathBuf> { Self::local_path(CONFIG_FILE_NAME) } |
