Skip to content

Commit 15de43a

Browse files
committed
允许设定行宽为unset
1 parent 777de6f commit 15de43a

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

CodeService/src/LuaEditorConfig.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,14 @@ void LuaEditorConfig::ParseFromSection(std::shared_ptr<LuaCodeStyleOptions> opti
367367
options->detect_end_of_line = configMap.at("detect_end_of_line") == "true";
368368
}
369369

370-
if (configMap.count("max_line_length")
371-
&& isNumber(configMap.at("max_line_length")))
370+
if (configMap.count("max_line_length"))
372371
{
373-
options->max_line_length = std::stoi(configMap.at("max_line_length"));
372+
if (isNumber(configMap.at("max_line_length"))) {
373+
options->max_line_length = std::stoi(configMap.at("max_line_length"));
374+
}
375+
else if(configMap.at("max_line_length") == "unset"){
376+
options->max_line_length = std::numeric_limits<int>::max();
377+
}
374378
}
375379

376380
if (configMap.count("enable_check_codestyle"))

lua.template.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ keep_line_after_expression_statement = keepLine
7474
# [diagnostic]
7575
# the following is code diagnostic options
7676
enable_check_codestyle = true
77-
# this mean utf8 length
77+
# this mean utf8 length , if this is 'unset' then the line width is no longer checked
7878
max_line_length = 120
7979
# this will check text end with new line(format always end with new line)
8080
insert_final_newline = true

0 commit comments

Comments
 (0)