diff --git a/plugins/autoindent.lua b/plugins/autoindent.lua index d84ef21..0d4b0bd 100644 --- a/plugins/autoindent.lua +++ b/plugins/autoindent.lua @@ -203,7 +203,7 @@ function dedent_amount(y) end -- Shortcut to indent a selection -event_mapping["alt_tab"] = function() +event_mapping["ctrl_tab"] = function() local cursor = editor.cursor local select = editor.selection if cursor.y == select.y then diff --git a/src/main.rs b/src/main.rs index 6691099..8e7363a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -86,7 +86,10 @@ fn run(cli: &CommandLineInterface) -> Result<()> { editor.borrow_mut().config.document.borrow_mut().file_types = file_types; // Open files user has asked to open + let cwd = std::env::current_dir()?; for (c, file) in cli.to_open.iter().enumerate() { + // Reset cwd + let _ = std::env::set_current_dir(&cwd); // Open the file editor.borrow_mut().open_or_new(file.to_string())?; // Set read only if applicable