-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to set the cfg to allow strings with \n or \r? #7
Comments
I ran into this same problem. The problem is not with the config. It's with the AppleScript that is run. On my system the AppleScript is at ~/Library/Services/Uncrustify_opened_Xcode_sources.workflow The problematic code is here:
I have not yet figured out a way to fix it though, not have I found a workaround. |
This code "fixes" the problem, but it creates a new one:
The problem is that removes ALL line breaks--not just the ones within a string. What we need is a regex, which is above my head. I'm hoping some else can find a fix for this. |
Here's a link to a stackoverflow post that I created before finding out that it was a bug. I'm posting this as a cross reference just in case anyone there finds a workaround. |
I just posted a workaround on the stackoverflow page. Here it is:
|
This string thing is such a bitch. |
Solved it. Given the direction above, replace the statement with whats below this paragraph. I submitted a commit, hopefully it can get fixed up and nobody else has to waste their Sunday wresting with AppleScript. 👍 if (suffix = "m" or suffix = "h") then tell application "Xcode" to (do shell script "'/usr/local/bin/uncrustify' -c " & "'" & uncrustifyConfigFilePath & "' -l OC --no-backup '" & currentDocumentPath & "'") end if Thanks for the plugin by the way! |
This might be ovi, but the &'s are actually & 's. |
Thanks for updating this heliumroe. I have tested your fix briefly and it seems to well for me. I have marked your answer as the accepted answer on stackoverflow. Once your pull request gets merged I would think that this issue could be closed. |
For example:
[NSString stringWithFormat:@"%@\r\n", message]
When running the formatter it also removes these instances of new lines / carriage return.
The text was updated successfully, but these errors were encountered: