1. Steps to reproduce bug - Create a file in the side brower area with any name. - Copy & paste any name with two rows. Such as "asdf1 \n asdf2". \n stands for a new line. - See image attached.
2. Expected result - Click the file to open it, you should see file name show at top correctly.
3. Actual result - Click the file to open it, you can see file name is not showing correctly. The buttom part of first line "asdf1" can be seen.
4. Environment - OS X version: 10.11.4 Beta - TextMate version: TextMate version 2.0-beta.12.4
On Aug 28, 2016, at 7:56 AM, Ian Dai iandaicsu@gmail.com wrote:
Copy & paste any name with two rows
A file _name_ shouldn't contain "two rows". A file name containing a newline character is a very strange notion. AFAIK, only Icon files do that. m.
-- matt neuburg, phd = http://www.apeth.net/matt/ pantes anthropoi tou eidenai oregontai phusei Programming iOS 9! http://shop.oreilly.com/product/0636920044352.do iOS 9 Fundamentals! http://shop.oreilly.com/product/0636920044345.do RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
Shouldn’t TextMate properly support any filename that is valid according to the operating system?
On 28 August 2016 at 18:25, Jacob Carlborg doob@me.com wrote:
Shouldn’t TextMate properly support any filename that is valid according to the operating system?
What is it you are expecting TM to do here?
TM *is* supporting the file, and displaying the newline in the filename.
Its a very odd requirement though, newline characters in filenames are almost always a bad idea
I don’t know. Perhaps TextMate replace the newline with \n when displaying it.
On 28 Aug 2016, at 16:56, Ian Dai wrote:
- Expected result
- Click the file to open it, you should see file name show at top
correctly.
Can you define “correctly”? Would you expect tabs to grow to twice the height? And the same for file browser rows? Or would you want TextMate to render the newline with a glyph?
Looking at how the system handles this, it does not :)
For example after `touch $'foo\nbar.txt'` this is what I see in Finder:
![](cid:D8839931-45AB-4084-BA12-33016F8071AA@textmate.org "PastedImage.png")
And this is how it shows in TextEdit’s title bar:
![](cid:4DA665C2-4E7E-415C-B896-C78BF5F06D24@textmate.org "PastedImage.png")
For the records TextMate uses `NSFileManager`’s `displayNameAtPath:` to obtain the display name which does things like replace `:` with `/`, hide extension, localize the display name, etc.
I think it would be more appropriate to report this to Apple and request the `displayNameAtPath:` also handle newlines.
On Aug 28, 2016, at 11:13 PM, Allan Odgaard mailinglist@textmate.org wrote:
I think it would be more appropriate to report this to Apple and request the displayNameAtPath: also handle newlines.
I still think it would be most appropriate just not to put newlines in your filename. Why would anyone do such a thing? "Doctor doctor it hurts when I go like _this_!" "So _don't_ go like that!" m.
-- matt neuburg, phd = http://www.apeth.net/matt/ pantes anthropoi tou eidenai oregontai phusei Programming iOS 9! http://shop.oreilly.com/product/0636920044352.do iOS 9 Fundamentals! http://shop.oreilly.com/product/0636920044345.do RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html