Skip to content

Commit

Permalink
fixed issues with cwd changing during opening of files
Browse files Browse the repository at this point in the history
  • Loading branch information
curlpipe committed Oct 24, 2024
1 parent f7faf09 commit 688d1d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/autoindent.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 688d1d0

Please sign in to comment.