Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

insert_final_newline will open all files when using Search & Replace #363

Open
2 tasks done
jpawlowski opened this issue Feb 5, 2024 · 0 comments
Open
2 tasks done

Comments

@jpawlowski
Copy link

Please fill-in this template.

  • I have a question that is specific to this extension; thus, inappropriate for the main EditorConfig issue tracker.
  • I tried running code --disable-extensions and the issue did NOT present itself.

Issue

Visual Studio Code editorconfig-vscode
Version 1.86.0 0.16.4

Root .editorconfig File

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

# PowerShell files
[*.{ps1,psd1,psm1,ps1xml,psc1,clixml}]
end_of_line = crlf
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

# Windows script and batch files
[*.{cmd,bat}]
end_of_line = crlf
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

# CSV, Markdown, and Text files
[*.{csv,md,txt}]
trim_trailing_whitespace = true

# JSON and XML files
[*.{json,xml,code-workspace}]
indent_style = space
indent_size = 2

# Matches the exact file .editorconfig
[.editorconfig]
indent_style = space
indent_size = 2

Are there any other relevant .editorconfig files in your project? No

Visual Studio Code Setting Default User Workspace
editor.insertSpaces true ____ ____
editor.tabSize 4 _ _
editor.trimAutoWhitespace true ____ ____
files.autoSave "off" "___" "___"
files.insertFinalNewline false _____ _____
files.trimTrailingWhitespace false _____ _____

File opened

None

Expected behavior

Strings are replaced for all files as intended; no file will be opened.

Actual behavior

When using the Search & Replace option of VScode to replace some text in all my files, every matching file is opened in a new tab. I need to explicitly save each file individually. That's annoying already, but before I can save a file, I need to take care of VScode's prompt window, asking me to confirm the overwrite of the file.

Additional comments or steps to reproduce

The only way to properly perform any mass changes to files like that is to temporarily disable the EditorConfig extension, or remove the insert_final_newline option from .editorconfig (for those trying: also restart VScode after performing such change).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant