Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

fix crlf modif on windows #449

Merged
merged 1 commit into from
Dec 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion server/features.v
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub fn (mut ls Vls) formatting(params lsp.DocumentFormattingParams, mut wr Respo
// To simplify this, we will make a temporary file and feed it into
// the v fmt CLI program since there is no cross-platform way to pipe
// raw strings directly into v fmt.
mut temp_file := os.open_file(server.temp_formatting_file_path, 'w')!
mut temp_file := os.open_file(server.temp_formatting_file_path, 'wb')!
temp_file.write_string(source.string())!
temp_file.close()
Comment on lines +26 to 28
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
mut temp_file := os.open_file(server.temp_formatting_file_path, 'wb')!
temp_file.write_string(source.string())!
temp_file.close()
os.write_file(server.temp_formatting_file_path, source.string())!

defer {
Expand Down
Loading