File tree Expand file tree Collapse file tree 5 files changed +32
-4
lines changed Expand file tree Collapse file tree 5 files changed +32
-4
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,9 @@ if(NOT "${TEST_COMPILE_RESULT}" OR (NOT "${TEST_RUN_RESULT}" EQUAL 0))
6161 message (FATAL_ERROR "Your compiler does not fully support the C++17 standard and libraries" )
6262endif ()
6363
64+ if ( ${CMAKE_BUILD_TYPE} MATCHES "Debug" )
65+ add_definitions (-DDEBUG)
66+ endif ()
6467
6568include_directories (
6669 ${PROJECT_SOURCE_DIR} /generated /
Original file line number Diff line number Diff line change 88
99using namespace antlr4 ;
1010
11- // #define LOG_FLAG
1211// #define LOG_FUNC_VISIT
1312
14- #ifdef LOG_FLAG
13+ #ifdef DEBUG
1514
1615static int logIndentSize = 0 ;
1716static std::string LOG_INDENT = " " ;
@@ -50,7 +49,7 @@ void func_end(std::string funcName) {
5049#endif
5150
5251void print_cost () {
53- #ifdef LOG_FLAG
52+ #ifdef DEBUG
5453 for (auto p : countMp) {
5554 std::cout << p.first << " called " << p.second << " times" << std::endl;
5655 }
@@ -891,7 +890,8 @@ antlrcpp::Any FormatVisitor::visitExplist(LuaParser::ExplistContext* ctx) {
891890 // var:foo(xxxx .. xxxx) -- no break
892891 // longlonglonglongvar:foo(
893892 // xxxx .. xxxx) -- break
894- if (lines > 1 && cur_columns () > config_.get <int >(" column_limit" ) / 2 ) {
893+ int column_limit = config_.get <int >(" column_limit" );
894+ if (lines > 1 && cur_columns () > column_limit / 2 && expLength >= column_limit / 4 ) {
895895 beyondLimit = true ;
896896 }
897897 if (!functioncallLpHasBreak_.empty () && functioncallLpHasBreak_.back ()) {
Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ TEST_FILE(PROJECT_PATH "/test/testdata/issues/issue-104.lua");
8383TEST_FILE (PROJECT_PATH " /test/testdata/issues/issue-156.lua" );
8484TEST_FILE (PROJECT_PATH " /test/testdata/issues/issue-162.lua" );
8585TEST_FILE (PROJECT_PATH " /test/testdata/issues/issue-168.lua" );
86+ TEST_FILE (PROJECT_PATH " /test/testdata/issues/issue-186.lua" );
8687
8788TEST_FILE (PROJECT_PATH " /test/testdata/issues/PR-100.lua" );
8889TEST_FILE (PROJECT_PATH " /test/testdata/issues/PR-108.lua" );
Original file line number Diff line number Diff line change 1+ self .buf , self .win , self .buf_closer = floatbuf ({
2+ win_width = self .rect .width ,
3+ win_height = self .rect .height ,
4+ x = self .rect .pos_x ,
5+ y = self .rect .pos_y ,
6+ loc = loc ,
7+ prompt = self .prompt ,
8+ enter = opts .enter ,
9+ ft = opts .ft ,
10+ syntax = opts .syntax ,
11+ relative = opts .relative
12+ })
Original file line number Diff line number Diff line change 1+ self .buf , self .win , self .buf_closer = floatbuf ({
2+ win_width = self .rect .width ,
3+ win_height = self .rect .height ,
4+ x = self .rect .pos_x ,
5+ y = self .rect .pos_y ,
6+ loc = loc ,
7+ prompt = self .prompt ,
8+ enter = opts .enter ,
9+ ft = opts .ft ,
10+ syntax = opts .syntax ,
11+ relative = opts .relative
12+ })
You can’t perform that action at this time.
0 commit comments