[TxMt] Re: untitled files not getting fileType setting for the targeted directory

Allan Odgaard mailinglist at textmate.org
Wed Aug 10 08:32:40 UTC 2016


On 8 Aug 2016, at 18:53, Curt Sellmer wrote:

> 1. When I select a directory in the file browser and the selected 
> directory
> is not open (ie. the triangle is pointing to the right) and press 
> ^⌘N the
> file is created not in the selected directory but as a sibling to the
> selected directory.  Perhaps this is by design?

The rationale is that you can have a directory with only other 
directories, if we always created inside the selected item, the user 
would have to take extra steps to select the parent (or deselect if 
parent is the file browser’s root).

This is also relevant when using copy/paste in the file browser (which 
use the same logic).

> 3. When I select a directory in the file browser and press ⌥⌘N, 
> (regardless
> of whether the directory is open or closed) I always get an untitled
> document with type 'text.plain'.   When I subsequently save the file 
> it
> correctly goes into the directory that was selected.
>
> - I'm guessing that with ⌥⌘N the file type is not being assigned 
> because
> the untitled doc does not yet actually exist in the directory.

Correct, in that _New Tab_ (⌥⌘N) does not reference the file 
browser. But I can try to make it do it, though it would fall victim to 
the same logic about needing to have the selected folder expanded.

I may revise the thing about expanded folder, but it introduces some 
code complexity because then we ought to expand the folder when creating 
a new file, and folder content is loaded asynchronously…
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20160810/96420fff/attachment.html>


More information about the textmate mailing list