[TxMt] Re: New file naming resets to untitled after a few milliseconds

Allan Odgaard mailinglist at textmate.org
Tue Apr 15 00:24:30 UTC 2014


On 15 Apr 2014, at 1:35, Igor K wrote:

> On 14 04 2014, at 20:25, Koen Punt <koen at koenpunt.nl> wrote:
>
>> I have some issues creating new files in the file browser. When I 
>> create a file (CMD+SHIFT+N) and start typing the filename quite often 
>> it reverts to untitled after a few milliseconds and I have restart 
>> typing.

The problem is that the field editor (used to rename items) has to be 
aborted to reload the contents of the file browser (i.e. the API 
dictates that).

The file browser will reload when there are changes on the disk 
(registered via fs-events). In the past it suppressed such reloading 
when the field editor was showing, but that had the issue that a user 
who accidentally did ⇧⌘N (New File) and then ⌘Z (Undo the new 
file) would not see the new file disappear (until confirming it’s 
name).

I try to restore the content of the field editor, but it does not always 
work. There isn’t much API to control these things, and TextMate’s 
approach with loading the content in the background folder-by-folder and 
then updating the table view on the main thread adds to the difficulty 
of handling this, as the item being edited might not be there after 
first reload, but may arrive later.

> Another thing that bugs me is that if you move/delete something then 
> start renaming something and while typing a name press ⌘Z you undo 
> the move/delete action instead of undoing what you were typing.

I pushed a fix for that¹ so next build should solve it — looks like 
it was introduced in v2.0-alpha.9525.

¹ 
https://github.com/textmate/textmate/commit/ae69d06c2c95e76a70606f77103fb84162d58517


More information about the textmate mailing list