LuaFormatter icon indicating copy to clipboard operation
LuaFormatter copied to clipboard

部分代码在处理引号时被截断分在了两行

Open Davider-code opened this issue 3 years ago • 7 comments

英文表达不太好,看到前面有朋友用中文描述,也知道了 @Koihik 是中国人,这里也冒昧用中文哈,非常感谢您的这个项目。

格式化下面的代码时,有些行被截断,被分在了两行,在行 2 24 29 33 视频演示:https://www27.zippyshare.com/v/B4Sg35M2/file.html

下面的代码是使用一个叫作AutoPlay Media Studio的软件生成的,代码没有格式化,看着很乱,所以想使用Sublime格式化一下。

期待K大方便的时候能帮看一下,非常感谢!

` -- Set the folder to search for folder = Dialog.Input("Folder Search", "Please Enter Folder Name:", "", MB_ICONQUESTION);

-- Get a list of the available drives and loop through returned table looking for folder. tbDrives = Drive.Enumerate();

for i,DriveLetter in pairs(tbDrives) do ---Get the drive type nType = Drive.GetType(DriveLetter)--we get the drive type and if fixed = 3 then search if nType == 3 then if not cancel then --check if user cancelled search, check globals StatusDlg.Show(0, false); search_results = Folder.Find(DriveLetter, folder, true, FindCallBack); --Check to see if an error occurred during the search. If it did, display the error message. error = Application.GetLastError(); StatusDlg.Hide(); if error ~= 0 then Dialog.Message("Error",_tblErrorMessages[error]); else -- If no directories were found, inform the user if (search_results == nil) then message = "No folder named " .. folder .. " on Drive " .. DriveLetter .. " found." Dialog.Message("Notice",message );

-- If folders were found, display a dialog containing a list of their locations. else message = "A folder named '" .. folder .. "' was found at the following location(s):\r\n\r\n"; for index, path in pairs(search_results) do message = String.Concat(message, path.."\r\n"); end Dialog.Message("File Search Results", message, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); end end

else

break;--exits loop

end end end `

Davider-code avatar Nov 18 '20 06:11 Davider-code

原代码.zip

Davider-code avatar Nov 18 '20 06:11 Davider-code

没看出来有什么问题, 超过column_limit了, 不就分成两行了吗

Koihik avatar Nov 20 '20 03:11 Koihik

感谢回复, ("Folder Search", "Please Enter Folder Name:", "", MB_ICONQUESTION); 像上面()中是函数的参数,格式化前是一行的,格式化后变为了两行,我拷回上面提示的软件后编译就报错了,有什么参数可以解决吗?感谢

Davider-code avatar Nov 21 '20 03:11 Davider-code

把column_limit调大

Koihik avatar Nov 21 '20 06:11 Koihik

感谢回复,搞了N多个小时,终于搞定,步骤如下: 1.在C盘新建一个config.txt文件,里面添加下面的一行代码,200是我自定义的列宽值,根据自己断行的实际情况修改即可 column_limit: 200

2.打开下面链接中的图片所示的文件,添加下面4行代码后ctrl+s保存 https://ibb.co/jgGwR9Z

{ "auto_format_on_save": false, "config_file": "C:\config.txt" }

3.打开自己的lua代码文件,按下ctrl+alt+L 看格式化后的效果

Davider-code avatar Nov 21 '20 10:11 Davider-code

把column_limit调大

您好,格式化代码后,会有回车符显示如下链接图,将配置示例中带true的都试了,还是关不掉,能提醒一下是哪个参数吗?非常感谢!!! https://ibb.co/9WwWSrL

Davider-code avatar Nov 21 '20 21:11 Davider-code

把column_limit调大

您好,格式化代码后,会有回车符显示如下链接图,将配置示例中带true的都试了,还是关不掉,能提醒一下是哪个参数吗?非常感谢!!! https://ibb.co/9WwWSrL

windows下的bug, 暂时还没修

Koihik avatar Nov 23 '20 02:11 Koihik