Skip to content

Commit f1c33ed

Browse files
committed
end_of_line支持auto配置
1 parent af4cbbd commit f1c33ed

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

CodeService/src/LuaEditorConfig.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,14 @@ void LuaEditorConfig::ParseFromSection(std::shared_ptr<LuaCodeStyleOptions> opti
325325
{
326326
options->end_of_line = "\n";
327327
}
328+
else if (lineSeparatorSymbol == "auto")
329+
{
330+
#ifndef _WINDOWS
331+
options->end_of_line = "\n";
332+
#else
333+
options->end_of_line = "\r\n";
334+
#endif
335+
}
328336
}
329337

330338
if (configMap.count("max_line_length")

lua.template.editorconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ table_append_expression_no_space = false
4646
if_condition_align_with_each_other = false
4747

4848
long_chain_expression_allow_one_space_after_colon = false
49-
# optional crlf/lf
50-
end_of_line = crlf
49+
# optional crlf/lf/auto, if it is 'auto', in windows it is crlf other platforms are lf
50+
end_of_line = auto
5151

5252
# [line layout]
5353
# The following configuration supports three expressions

0 commit comments

Comments
 (0)