refactor: change the name of the variable

macos-click-through
Sergio Ribera 2 years ago
parent f125f054ff
commit c3533897ac

@ -87,9 +87,9 @@ async fn start_neovim_runtime() {
start_ui_command_handler(nvim.clone()); start_ui_command_handler(nvim.clone());
// Verify if the files to open is more than one // Verify if the files to open is more than one
if settings.files.len() > 1 { if settings.target_files.len() > 1 {
// Open the rest of the files into new tabs // Open the rest of the files into new tabs
for file in settings.files.iter().skip(1) { for file in settings.target_files.iter().skip(1) {
nvim.command(format!("tabnew {}", file).as_str()) nvim.command(format!("tabnew {}", file).as_str())
.await .await
.unwrap_or_explained_panic("Could not create new tab"); .unwrap_or_explained_panic("Could not create new tab");

@ -23,7 +23,7 @@ pub struct CmdLineSettings {
pub wayland_app_id: String, pub wayland_app_id: String,
pub x11_wm_class: String, pub x11_wm_class: String,
// Command-line arguments with multiple files // Command-line arguments with multiple files
pub files: Vec<String>, pub target_files: Vec<String>,
} }
impl Default for CmdLineSettings { impl Default for CmdLineSettings {
@ -48,7 +48,7 @@ impl Default for CmdLineSettings {
wayland_app_id: String::new(), wayland_app_id: String::new(),
x11_wm_class: String::new(), x11_wm_class: String::new(),
// Command-line arguments with multiple files // Command-line arguments with multiple files
files: vec![], target_files: vec![],
} }
} }
} }
@ -201,8 +201,7 @@ pub fn handle_command_line_arguments(args: Vec<String>) -> Result<(), String> {
.map(|v| v.to_owned()) .map(|v| v.to_owned())
.or_else(|| std::env::var("NEOVIDE_X11_WM_CLASS").ok()) .or_else(|| std::env::var("NEOVIDE_X11_WM_CLASS").ok())
.unwrap_or_else(|| "neovide".to_owned()), .unwrap_or_else(|| "neovide".to_owned()),
// Command-line arguments with multiple files target_files: matches
files: matches
.values_of("files_to_open") .values_of("files_to_open")
.map(|opt| opt.map(|v| v.to_owned()).collect()) .map(|opt| opt.map(|v| v.to_owned()).collect())
.unwrap_or_default(), .unwrap_or_default(),

Loading…
Cancel
Save