Home Download Buy Blog Forum Support

Dev Build 2041

Dev Build 2041

Postby jps on Mon Mar 07, 2011 12:06 pm

Dev Build 2041 is out now. The main feature is configurable mouse input, via the new *.sublime-mousemap files. With these, you can bind commands against buttons, buttons with modifiers, the scroll wheel, and chorded buttons (e.g., button 1 pressed while button 2 is held down). I've added a few to start with, but we'll see how things go:

  • Hold down the right mouse button (aka button 2), and scroll with the mouse wheel to change files. Opera was the clear inspiration here. This happens on Windows and Linux only, as on OS X the context menu is shown as soon as button 2 is depressed.
  • Buttons 4 and 5 also go to the next / prev file.
  • Hold button 2, and then:
    - Click button 1: select line
    - Double click button 1: select paragraph
    - Triple click button 1: select all
    (again, not on OS X)
Anyway, have a play, and let me know what you think. The sublime-mousemap files work a lot like the keymap ones, in that they're platform specific, and you can override them by putting a file with the same name in your User directory.

The quote pairing changes deserve pointing out too: previously, they'd sometimes insert two quotes when you only want one, e.g., when trying to close a string after deleting the end quote. This shouldn't be an issue any more.

Keyboard input has also been reworked, although for the most part you won't notice any difference. Some of the changes:
  • For keys that emit characters, e.g., 'a', '1', '.' (but not tab, space, enter), the key name to bind against is the unshifted character on the key, e.g., '.' rather than 'period' now. The old names will continue to work, however.
  • On OS X and Linux, all keys are now bindable. For example, with a German keyboard layout, you can bind "Ctrl+ö", whereas you couldn't before. Windows continues to work the same way as it did previously, where you have to bind against the virtual key code (e.g., Ctrl+` to trigger on the ö key).
  • On Linux, the key names displayed in the menu are now sensible.
There are a few other misc changes too: window positions are restored in Linux, Command+C etc work in OS X open and save dialogs, and Ctrl+W/Command+W are able to close the window. 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 2041

Postby jps on Mon Mar 07, 2011 12:34 pm

Contexts aren't supported in mousemaps, but there's no reason they couldn't be - just need some compelling examples to justify the code.

I'm planning to add mouse gestures in the future, but it needs UI support to be done properly, and there are other things that need doing first.
jps
Site Admin
 
Posts: 3062
Joined: Wed Mar 19, 2008 12:33 pm

Re: Dev Build 2041

Postby jps on Mon Mar 07, 2011 12:47 pm

Here's an example of something else that can be done in the mousemap:

Code: Select all
{
   "button": "button4", "modifiers": ["ctrl"],
   "command": "cut", "press_command": "drag_select"
}


This will let you select a block of text with ctrl+mouse4, and the text will be cut as soon as you release the button.
jps
Site Admin
 
Posts: 3062
Joined: Wed Mar 19, 2008 12:33 pm

Re: Dev Build 2041

Postby guillermooo on Mon Mar 07, 2011 12:59 pm

This sounds pretty interesting:

    Build files may specify environment variables, using the env key
    Added build_env file preference, which will be picked up by the build system
    Added env file preference, which will be picked up by the build system

Could you elaborate on how this works?
guillermooo
 
Posts: 725
Joined: Thu Jul 23, 2009 9:06 am

Re: Dev Build 2041

Postby jbrooksuk on Mon Mar 07, 2011 1:03 pm

jps wrote:This will let you select a block of text with ctrl+mouse4, and the text will be cut as soon as you release the button.

Now all I need is my 8-button mouse!
jbrooksuk
 
Posts: 754
Joined: Sun Apr 11, 2010 10:37 am
Location: England

Re: Dev Build 2041

Postby rchl on Mon Mar 07, 2011 1:22 pm

jps wrote:Contexts aren't supported in mousemaps, but there's no reason they couldn't be - just need some compelling examples to justify the code.

Not sure if that's related but the thing I wanted to do is to put "Copy full file path" item into tab's context menu.

So I've added:
" { "command": "copy_path", "caption": "Copy Full File Path" }, "
to "Tab Context.sublime-menu".

and that works but only on active tab. If I use it on background tab then it still copies path of active file.

So if that's somehow related to your work done here, then maybe it's easy to fix now.
rchl
 
Posts: 147
Joined: Fri Mar 04, 2011 11:02 pm

Re: Dev Build 2041

Postby guillermooo on Mon Mar 07, 2011 1:42 pm

sublimator wrote:Seems exec takes `env` keyword arg for per `run` configuration, seemingly expecting a mapping like {"BLA": "BLA"}.

There's also a settings key `build_env` which takes a map. I'm assuming the run `env` vars `win`


I guess so. I haven't downloaded the build yet, was hoping for easy answers :)
guillermooo
 
Posts: 725
Joined: Thu Jul 23, 2009 9:06 am

Re: Dev Build 2041

Postby theblacklion on Mon Mar 07, 2011 1:55 pm

jps wrote:Contexts aren't supported in mousemaps, but there's no reason they couldn't be - just need some compelling examples to justify the code.


Take for example "left click on a link opens an url". I've written a syntax file and a TextCommand. With mouse bindings I would also be able to trigger this TextCommand via a left click. Currently it's only triggered when in the correct scope and pressing enter.

PS: I'm currently writing something like orgmode. Of course it does not have all the bells and whistles yet, but mouse interaction is one thing I would need/want anyway for this project.
theblacklion
 
Posts: 67
Joined: Sat Feb 05, 2011 10:07 pm
Location: Hannover, Germany

Re: Dev Build 2041

Postby theblacklion on Mon Mar 07, 2011 2:07 pm

Or another example:
My orgmode plugin has checkboxes. These can currently be toggled by bringing the cursor over them (correct scope) and hitting return. This could also be triggered alternatively by a left click.
theblacklion
 
Posts: 67
Joined: Sat Feb 05, 2011 10:07 pm
Location: Hannover, Germany

Re: Dev Build 2041

Postby jbrooksuk on Mon Mar 07, 2011 2:11 pm

theblacklion wrote:Or another example:
My orgmode plugin has checkboxes. These can currently be toggled by bringing the cursor over them (correct scope) and hitting return. This could also be triggered alternatively by a left click.

I take it the context would be that the mouse click is between [] right?
jbrooksuk
 
Posts: 754
Joined: Sun Apr 11, 2010 10:37 am
Location: England

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 15 guests