Sublime Forum

Nightly Build 2197

#1

Nightly Build 2197 is out now, with some improvements to build systems. Notably, build system variants are now supported, for example, here’s C++.sublime-build:

{
	"cmd": "g++", "${file}", "-o", "${file_path}/${file_base_name}"],
	"file_regex": "^(..^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
	"working_dir": "${file_path}",
	"selector": "source.c, source.c++",

	"variants":
	
		{
			"name": "Run",
			"cmd": "bash", "-c", "g++ '${file}' -o '${file_path}/${file_base_name}' && '${file_path}/${file_base_name}'"]
		}
	]
}

Each variant overrides properties in the build system, and can be selected from the Command Palette when the build system in question is active. If there’s a variant called “Run”, it’ll also show up in the Tools menu, and will be trigged with Ctrl+Shift+B / Cmd+Shift+B.

Additionally, the “build” command now accepts a variant parameter, so you can bind keys to other variants, too.

0 Likes

#2

Simplified/traditional Sublime Text 2 Build 2197 Supporthttp://hi.baidu.com/%C6%AE%D2%DD%B5%E3/blog

0 Likes

#3

@Jps: thanks for the update!

@PIAOYIDIAN: You could post the patch on github and be automatically updated via package control :wink:

0 Likes

#4

Nice improvements to the build system, thanks Jon.

I’ve only one complaint (so far):

I’ve build files that don’t have a kind of ‘default’ build, for example an export restructuredtext to html or pdf in different language. I have to choose which kind of export I want each time I use it.
And sometimes I really like to have to explicitly choose the variant, like executing SQL command on a specific database. Running the SQL command on the wrong database could have very very bad effect.
Explicitly choosing the variant database minimize user errors.

Actually if you only use variants without a base cmd, the “Build: Build” is displayed in the Command Palette and the Build command run an empty cmd which trigger an error.
Is it possible that, when there is no default cmd, to remove “Build: Build” from Command Palette and disable the build command so user MUST run it via Command Palette ?

And is it possible to add the “name” entry for the base cmd and use it for the Command Palette instead of “Build: Build” ?
edit: Forgot that “name” is already used when you add “build_systems” in a project. Hum, is this a problem ?

I suppose I can remove my plugin https://github.com/bizoo/MultiTaskBuild that do almost the same things in a different manner (using quick_panel instead of Command Palette).

0 Likes

#5

A bug in the new build system:

variants are always executed with exec command whatever you specify in the “target” field in the base or in the variant.
Only the “target” from base are used for the base cmd.

Now I suppose that using exec command as default for variants whatever “target” is specified in the base is a good idea, but if a “target” is specified in the variant it must be used.

0 Likes

#6

Hope I will not be banned as spammer…

Jon, what do you think about adding something like that in the build command:

if target == "exec" and cmd == "": window.run_command("show_overlay", {"overlay": "command_palette", "text": "Build:"})
This way if there is no “cmd” and no “target” defined in the sublime-build file, a nice quick panel appears with the available Build variants.

I created a keybinding for this but having it to be displayed automatically when you trigger a Build is even better.

0 Likes

#7

Jon, thanks for the ignore_inodes setting. :smile:

Edit: Seems I spoke too soon… the console doesn’t report skipping any files/folders, but after restarting with ’ “ignore_inodes”: true ', my whole project directory is empty. :frowning:

0 Likes

#8

I don’t always use Distraction Free Mode, but when i do : http://i.imgur.com/PIL6S.jpg

0 Likes

#9

Is there now a way to disable the console panel from appearing in build systems?

I tried setting show_panel_on_build to false, but it seems to show the panel anyway (and the build system seems to fail silently).

0 Likes

#10

Would love to see *.cache file added to the default “file_exclude_patterns”

0 Likes

#11

Select text near the end of a 20 lines plus (or so) file, then cut it (cmd-x). After that, when you try to place the cursor within the region of the cut text, it always creates a selection from the end of the file.

0 Likes

#12

My Edit menu has vanished from the menu bar:

I can’t be sure this happened in Build 2197, but I checked Build 2181 and there was no problem.

0 Likes

#13

@hubert, I think that’s been around since 2181 – although still haven’t figured out how to stop it.

0 Likes

#14

@thomasedwards/@hubert

That sounds similar to selection issues I and others have experienced. Try setting scroll_past_end to true in your user preferences and see if that makes a difference.

0 Likes

#15

I can confirm that the problem of the disappearing Edit menu, which I reported above, has arisen only in Build 2197. I’ve gone back to 2196, and my Edit menu has reappeared.

0 Likes

#16

This is a very minor little UI annoyance, but there is no bottom arrow when viewing long toolbar menus.
I’ve scrounged around a lot of color schemes and here’s how it looks at the bottom of my screen (1920x1200):


I’m not able to scroll down any further using the mouse.

0 Likes

#17

This is a long standing bug that I kind of thought would get resolved, but I think I will post it here.

On windows, if I drag a tab out of a window and drop it outside to create a new window, sometimes the window is created off screen. This can be very annoying because then you have to right click the taskbar item, select move and try and bring it back into view with dragging and the arrow keys.

I have a dual monitor setup, so usually I am tearing off a tab and dropping it on the second monitor. This has been the case on XP and Win7, so I don’t think it is specific to a version of winodws.

0 Likes

#18

[quote=“facelessuser”]This is a long standing bug that I kind of thought would get resolved, but I think I will post it here.

On windows, if I drag a tab out of a window and drop it outside to create a new window, sometimes the window is created off screen. This can be very annoying because then you have to right click the taskbar item, select move and try and bring it back into view with dragging and the arrow keys.

I have a dual monitor setup, so usually I am tearing off a tab and dropping it on the second monitor. This has been the case on XP and Win7, so I don’t think it is specific to a version of winodws.[/quote]

I’ve dealt with this also. It can be made less annoying be doing the Move as you said, just tapping the arrow keys, then moving the mouse. For whatever reason, moving the mouse doesn’t work until you’ve hit the arrow keys once.It’s much easier to find the window with the mouse though.

0 Likes

#19

I’m not sure if this was an issue in previous version:

In Windows 7, I’m running into a bug in which

  1. If a menu is too tall to fit on the screen, and
  2. If Sublime Text 2 is on the second screen of a dual-monitor set up (maximized or not),
    the arrow to scroll down the menu does not appear
    Working on the main screen: http://i.imgur.com/Yrry7.jpg
    Not working on second screen: http://i.imgur.com/hvO07.jpg
0 Likes

#20

Hey, this was the last nightly release and it’s been quite a while now - I’m hoping the bus factor has not come in to play here?

0 Likes