rename copy_string to copy_to_clipboard

pull/36/head
Takayuki Maeda 3 years ago
parent 0b6925f2b4
commit 74d0984276

@ -1,4 +1,4 @@
use crate::clipboard::copy_string;
use crate::clipboard::copy_to_clipboard;
use crate::components::{CommandInfo, Component as _, DrawableComponent as _, EventState};
use crate::database::{MySqlPool, Pool, PostgresPool, RECORDS_LIMIT_PER_PAGE};
use crate::event::Key;
@ -260,7 +260,7 @@ impl App {
if key == self.config.key_config.copy {
if let Some(text) = self.record_table.table.selected_cells() {
copy_string(text.as_str())?
copy_to_clipboard(text.as_str())?
}
}
@ -310,7 +310,7 @@ impl App {
if key == self.config.key_config.copy {
if let Some(text) = self.structure_table.selected_cells() {
copy_string(text.as_str())?
copy_to_clipboard(text.as_str())?
}
};
}

@ -40,7 +40,7 @@ fn gen_command(path: impl AsRef<OsStr>, xclip_syntax: bool) -> Command {
}
#[cfg(all(target_family = "unix", not(target_os = "macos")))]
pub fn copy_string(string: &str) -> Result<()> {
pub fn copy_to_clipboard(string: &str) -> Result<()> {
use std::path::PathBuf;
use which::which;
let (path, xclip_syntax) = which("xclip").ok().map_or_else(
@ -58,11 +58,11 @@ pub fn copy_string(string: &str) -> Result<()> {
}
#[cfg(target_os = "macos")]
pub fn copy_string(string: &str) -> Result<()> {
pub fn copy_to_clipboard(string: &str) -> Result<()> {
execute_copy_command(Command::new("pbcopy"), string)
}
#[cfg(windows)]
pub fn copy_string(string: &str) -> Result<()> {
pub fn copy_to_clipboard(string: &str) -> Result<()> {
execute_copy_command(Command::new("clip"), string)
}

Loading…
Cancel
Save