Home Download Buy Blog Forum Support

Dev Build 2043

Dev Build 2043

Postby jps on Wed Mar 09, 2011 11:00 am

Dev Build 2043 is out now. Dev Builds are in-progress versions of Sublime Text 2 - use them if you want the latest features, but keep in mind that you will encounter more bugs.

I've been working on menus for this build, you can see this in a few areas:
- Right click on a directory in the side bar, and you can create a new file at that location
- Right click some files in the side bar, and you can delete them (files in folders only, not open files)
- Right click with two files selected in the side bar, and you can diff them

I'm planning to expand the file manipulation related commands on the sidebar in the future, to allow new directories to be created, and files to be renamed. I'm not intending on writing a finder/explorer/nautilus replacement, however.

Individual packages may now extend menus, too. You can see a minimalist example of this in the new Diff packages, which extends Context.sublime-menu and Side Bar.sublime-menu. It's also possible to extend the main menu, although it's a little bit tricker, as you need to make sure your menu items go in the right spot, and not just at the end. An example Main.sublime-menu is:

Code: Select all
[
    {
        "id": "tools",
        "children":
        [
            {
                "id": "packages",
                "children":
                [
                    {
                        "caption": "Talk",
                        "children":
                        [
                            { "caption": "Hello, World!", "command": "echo" }
                        ]
                    }
                ]
            }
        ]
    }
]


This adds a new sub-folder to Tools/Packages called "Talk", with a single "Hello, World!" menu item inside.

Snippets have also received some attention: punctuation based tab triggers work again, and the snippet fields are much more proactive about cancelling themselves than they were before.

Finally, inspired by theblacklion's diff plugin, there's now an entry on the context menu to diff the current buffer against the on disk version, showing you the unsaved changes.

The full list of changes is on the Dev Build page, as usual.
jps
Site Admin
 
Posts: 3062
Joined: Wed Mar 19, 2008 12:33 pm

Re: Dev Build 2043

Postby bizoo on Wed Mar 09, 2011 12:06 pm

Nice work Jon, thanks.

Now the first bug report :(

Diff command only work on unicode files, with windows-1252 files:
Traceback (most recent call last):
File ".\sublime_plugin.py", line 230, in run_
File ".\diff.py", line 25, in run
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 17: ordinal not in range(128)

startup, version: 2043 windows x64 channel: dev
bizoo
 
Posts: 873
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: Dev Build 2043

Postby ekolguy on Wed Mar 09, 2011 12:14 pm

Good work, diff highlighting rocks!

Some bugs I encountered:

* Show unsaved changes sometimes works, sometimes does not. I could not figure out the exact reason, but in my tests this action on my local_settings.py.example file works (opens a diff file) while on the similar file, settings.py does not (opens an empty diff file)
* I cannot figure out how Diff already opened files as multiple file selection and right click is not available there. Does it mean we can only diff files that are not yet opened (via file browser) ?
* New file context menu does not actually create a file. It creates a new buffer ready to be saved in given directory. Is this the way it supposed to function? What will happen if you add New folder context menu?
ekolguy
 
Posts: 41
Joined: Thu Dec 17, 2009 8:50 am

Re: Dev Build 2043

Postby theblacklion on Wed Mar 09, 2011 12:45 pm

Hmm.. auto-save and show unsaved changes kind of bite each other. Auto-save is being triggered on_deactivated which the diff invokes. Any idea for a workaround?

Btw... love it :)
theblacklion
 
Posts: 67
Joined: Sat Feb 05, 2011 10:07 pm
Location: Hannover, Germany

Re: Dev Build 2043

Postby jps on Wed Mar 09, 2011 1:04 pm

bizoo wrote:Diff command only work on unicode files, with windows-1252 files:


Thanks, I'll look into it

ekolguy wrote:* Show unsaved changes sometimes works, sometimes does not. I could not figure out the exact reason, but in my tests this action on my local_settings.py.example file works (opens a diff file) while on the similar file, settings.py does not (opens an empty diff file)
* I cannot figure out how Diff already opened files as multiple file selection and right click is not available there. Does it mean we can only diff files that are not yet opened (via file browser) ?
* New file context menu does not actually create a file. It creates a new buffer ready to be saved in given directory. Is this the way it supposed to function? What will happen if you add New folder context menu?


* It'll show an empty buffer if there's no difference between the current file and the on disk one. I'll change it to emit a status message in this scenario instead.
* I'm planning to make open files still selectable in the folder area, which will resolve this issue
* New File is working the way it's supposed to, yeah. My personal feeling is that this is a better option than prompting for a filename and creating something on disk immediately. New Folder will just prompt though.

theblacklion wrote:Hmm.. auto-save and show unsaved changes kind of bite each other. Auto-save is being triggered on_deactivated which the diff invokes. Any idea for a workaround?


I'll make the unsaved changes show up in an output panel instead, which is a better thing to do, and will go some way to resolving this issue, as long as you don't click in the output panel, anyway :)
jps
Site Admin
 
Posts: 3062
Joined: Wed Mar 19, 2008 12:33 pm

Re: Dev Build 2043

Postby jbrooksuk on Wed Mar 09, 2011 1:32 pm

What does Diff highlighting do exactly?

Now that new file/folder/delete is on the sidebar, can we please get rename?

I'm excited to see what kind of plugins will arise from this new extensibility — context menus!
jbrooksuk
 
Posts: 753
Joined: Sun Apr 11, 2010 10:37 am
Location: England

Re: Dev Build 2043

Postby ekolguy on Wed Mar 09, 2011 1:35 pm

jps wrote:* It'll show an empty buffer if there's no difference between the current file and the on disk one. I'll change it to emit a status message in this scenario instead.


The problem is, both of those files have unsaved changes in them.
ekolguy
 
Posts: 41
Joined: Thu Dec 17, 2009 8:50 am

Re: Dev Build 2043

Postby stiang on Wed Mar 09, 2011 2:24 pm

ekolguy wrote:
jps wrote:* It'll show an empty buffer if there's no difference between the current file and the on disk one. I'll change it to emit a status message in this scenario instead.


The problem is, both of those files have unsaved changes in them.

I am seeing the same behaviour on OS X 10.6.6. Save a file, do some changes, select Show Unsaved Changes, empty buffer.

This appears to always be the case for .html.erb files (which maps to the HTML (Rails) syntax), but for .js files Show Unsaved Changes works as expected.

Edit: Oh yeah, and thanks for a great update! ST2 is getting really, really good.
Last edited by stiang on Wed Mar 09, 2011 2:50 pm, edited 1 time in total.
stiang
 
Posts: 39
Joined: Sat Jan 29, 2011 12:34 pm

Re: Dev Build 2043

Postby daylerees on Wed Mar 09, 2011 2:25 pm

With the new file creation from sidebar, would it be possible to specify a filename when creating the file, so kind of :

Right click folder -> click new file -> type name of file within tree -> begin editing file.

Thanks for all the changes :)
daylerees
 
Posts: 22
Joined: Wed Feb 02, 2011 12:12 pm

Re: Dev Build 2043

Postby bizoo on Wed Mar 09, 2011 3:11 pm

stiang wrote:
ekolguy wrote:
jps wrote:* It'll show an empty buffer if there's no difference between the current file and the on disk one. I'll change it to emit a status message in this scenario instead.


The problem is, both of those files have unsaved changes in them.

I am seeing the same behaviour on OS X 10.6.6. Save a file, do some changes, select Show Unsaved Changes, empty buffer.

This appears to always be the case for .html.erb files (which maps to the HTML (Rails) syntax), but for .js files Show Unsaved Changes works as expected.

Edit: Oh yeah, and thanks for a great update! ST2 is getting really, really good.


Same here, look at the console if you don't have an error like:
Traceback (most recent call last):
File ".\sublime_plugin.py", line 230, in run_
File ".\diff.py", line 25, in run
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 17: ordinal not in range(128)

The error happen between the creation of the diff buffer and the filling of it, so the result is an empty buffer...
bizoo
 
Posts: 873
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Next

Return to General Discussion

Who is online

Users browsing this forum: Soulsbane, Yahoo [Bot] and 21 guests