Home Download Buy Blog Forum Support

Latest v2 (b2051) broken?

Latest v2 (b2051) broken?

Postby aguenter on Sun Mar 20, 2011 9:11 pm

Hi,

ST2 asked me to update a few days ago, which I have done. Now I no longer see the character encoding or line termination type in the status bar. I swear this was there before the update (or am I crazy and it wasn't?), but now all I see is line and column numbers on the left hand side.

Also, when I start a new document and paste in some PHP the syntax highlighting is correct but the selected syntax in the View->Syntax menu is wrong. It will either remain Plain Text or become HTML (??), for example:

Code: Select all
<?php

echo 'hello';

...results in no change to the Plain Text syntax selection, but the colors are properly applied.

Code: Select all
<?php

class MyClass {
   
}

Syntax = HTML

Code: Select all
<?php

class MyClass {
   
}

?>

Syntax = Plain Text

Code: Select all
<?php

function poop() { return null; }

Syntax = Plain Text

Code: Select all
<?php
namespace \myns;

use \Exception;

try {
   
   throw new Exception('ಠ_ಠ');
}
catch (Exception $e) {
   
   throw $e;
}

Syntax = Plain Text

Actually, it almost seems to depend on the source of the paste? Even though the syntax highlighting always works properly, I can never get it to identify the syntax type as PHP.

Thanks!
aguenter
 
Posts: 3
Joined: Sun Mar 20, 2011 8:49 pm

Re: Latest v2 (b2051) broken?

Postby benforr on Mon Mar 21, 2011 6:13 am

I can't speak to the encoding and LT issues you're seeing, but it appears 2051 broke column select on the Mac. Instead of control + left click selecting in column mode, it inherits the OSX default of a secondary click (context menu). I rolled back to 2047 temporarily... None of the mouse methods outlined in the link below allow column selection:
http://www.sublimetext.com/docs/2/column_selection.html
benforr
 
Posts: 2
Joined: Mon Mar 21, 2011 6:08 am

Re: Latest v2 (b2051) broken?

Postby jps on Mon Mar 21, 2011 12:58 pm

aguenter: that's all working as designed.

The status bar has never shown encoding nor line endings in Sublime Text 2, that's from Sublime Text 1. It is on the todo list though.

When you paste source code into an empty file, it will attempt to automatically detect the syntax of what was pasted in. HTML is the correct syntax to use for .php files (as it's the 'outer' syntax if you like). When you select PHP from the menu it's just acting as an alias for HTML.

benforr: Column select on mac is now option+left click, so that ctrl+click can show the context menu. I've updated the documentation to reflect this now.
jps
Site Admin
 
Posts: 3062
Joined: Wed Mar 19, 2008 12:33 pm

Re: Latest v2 (b2051) broken?

Postby aguenter on Mon Mar 21, 2011 9:18 pm

Thanks for the reply!

Regarding the syntax issue, I don't quite understand the purpose of the syntax menu, then. Does this not change which package is used?

Personally, I pretty much never write PHP blocks within markup, and as HTML is only the "outer syntax" when PHP is being interpreted for Apache/IIS/whatever this seems incorrect to me. I'm sure you're aware that PHP is a scripting language with a standalone interpreter that, although often used via CGI or as a webserver module, is much more than that.

Also, there still seems to be an issue with detection regardless of the semantics, as sometimes it never changes from Plain Text to HTML (as evidenced in my examples).

One more thing, if I may. This one might be in the wrong forum section, but I'm not sure that it deserves a new post as I don't know if it is a feature request or bug report:
I'm using tab indentation and I've noticed that when I'm within a nested block and insert a linefeed/carriage return it will properly indent the new line to the current indentation level, but if I don't type anything and insert another LF, the blank line I had created does not preserve its indentation. Rather, it truncates it completely and only the LF remains.

For example:
Code: Select all
{<LF>
    <cursor is here>blahblah<LF>
    <cursor is here, previous line preserved indentation><LF>
    <cursor is here, previous line lost indentation>


Is this expected behavior (to reduce file size maybe)? If so, would you mind making this a boolean toggle in the config? I know in order to add something to a blank line you can just move the cursor to the beginning of it, press TAB once, and it will return to the proper indentation level...but, I'm using adzenith's Indent Guides plugin and it causes broken indentation guide lines which looks horrible. Line wrapping also breaks them too, obviously, but this is expected behavior as it's still the same line. Here's a screencap:

Image

Regardless of these few small gripes (of which the last bothers me the most), so far ST2 is the best all-purpose editor I've ever used. It just feels...right, it's hard to explain. The DX/GL rendering is definitely part of it. :D I've turned a few friends on to it since I discovered it last week and they all agree and love it as well. Thank you and keep up the great work!
aguenter
 
Posts: 3
Joined: Sun Mar 20, 2011 8:49 pm

Re: Latest v2 (b2051) broken?

Postby jps on Mon Mar 21, 2011 9:56 pm

The syntax detection is not sophisticated, and will generally not detect HTML. It's mostly there to detect the blindingly obvious cases, such as when a file starts with "#!/usr/bin/python". The syntax menu is used to explicitly set the syntax, for new files, or when the syntax detection doesn't do what you want.

Wtih regards to your indentation question, it sounds like turning off the trim_automatic_white_space setting will do what you want.
jps
Site Admin
 
Posts: 3062
Joined: Wed Mar 19, 2008 12:33 pm

Re: Latest v2 (b2051) broken?

Postby aguenter on Mon Mar 21, 2011 11:11 pm

Brilliant, that did it. Thanks.
aguenter
 
Posts: 3
Joined: Sun Mar 20, 2011 8:49 pm

Re: Latest v2 (b2051) broken?

Postby benforr on Mon Mar 21, 2011 11:40 pm

Thanks jps, option works as advertised for column selection. I tried shift, command, not sure why I didn't try option, it is the 'magic' button in OSX, makes sense :-S
benforr
 
Posts: 2
Joined: Mon Mar 21, 2011 6:08 am


Return to Technical Support

Who is online

Users browsing this forum: askeeve, jbrooksuk, Yahoo [Bot] and 28 guests