Home Download Buy Blog Forum Support

General Questions

General Questions

Postby adambowen on Fri Mar 04, 2011 10:53 am

I've been using Sublime Text 2 for a couple of weeks now, and I'm considering making the switch from SciTE permanent but had a few problems/questions :

(1) There are a few problems with the syntax highlighting for C++, namely comments are not always highlighted correctly and a number of keywords (namespace, private, protected and public) are not always highlighted (at least with the Sunburst theme).

I've fixed the latter problems to my satisfaction by modifying the C++.tmLanguage file (attached). I don't really understand the tmLanguage parsing well enough to fix the former, but it seems that the function highlighting captures everything up to the opening brace and therefore doesn't apply a lot of other highlighting - however, in C++ it's very common to have initialiser lists between the header and the body of a function in constructors so this can be problematic.

(2) I'm storing most of my custom settings in the Packages/User directory, which I've symlinked to Dropbox to keep everything in sync (I'm not entirely sure how I'm going to achieve the same thing on Windows, but I'll cross that bridge when it comes to it). I'm curious as to if anyone else has a "Better Way", in particular it means things like modifications to C++.tmLanguage won't get synced (incidentally my first attempt linked the entire Packages directory but there seemed to be an incompatibility that messed up the interface under OSX). It also means that custom snippets appear in the User menu rather than their particular language menu.

(3) I realise that the spell checking functionality isn't fulling integrated yet, but is it possible to control the word separators ('/' doesn't seem to be treated as a word separator) and is there some kind of user dictionary for all my favourite non-words? Obviously the latter could be achieved just by editing the source dictionary - but that seems like overkill somehow.

(4) The initial window size is horrible (under Ubuntu 10.04 at least)... what's the easiest way to fix that? Ideally in terms of rows/columns of visible text verses brute force pixel size.

(5) How are conflicts in the syntax filename patterns resolved? Sublime has a built in txt syntax mode, and I have a custom tmLanguage file in my User directory for CMakeLists.txt - but Sublime always seems to prefer the the more general txt match - it would be preferable if it took the best match (in terms of most characters matched I guess) rather than, as it appears to, the first one it comes across.

(6) Is there a way to get Sublime to reload its settings without restarting? At the moment tweaking language definitions and configuration options is quite cumbersome because I have to restart to check the effects.

(7) For me, Ctrl+F, F3 appears to search backwards whilst Shift+F3 searches forwards (the Find and Find Prev buttons also appear to be reversed). I have not rebound any keys. I have no idea how I have managed this.

Any advice would be greatly appreciated!
Attachments
C++.tmLanguage.zip
(2.07 KiB) Downloaded 146 times
adambowen
 
Posts: 3
Joined: Mon Feb 28, 2011 11:11 am

Re: General Questions

Postby jps on Tue Mar 08, 2011 11:46 am

adambowen wrote:(2) I'm storing most of my custom settings in the Packages/User directory, which I've symlinked to Dropbox to keep everything in sync (I'm not entirely sure how I'm going to achieve the same thing on Windows, but I'll cross that bridge when it comes to it). I'm curious as to if anyone else has a "Better Way", in particular it means things like modifications to C++.tmLanguage won't get synced (incidentally my first attempt linked the entire Packages directory but there seemed to be an incompatibility that messed up the interface under OSX). It also means that custom snippets appear in the User menu rather than their particular language menu.


It may be worth trying to sync the entire Packages dir again: it's something that should be working ok.

adambowen wrote:(5) How are conflicts in the syntax filename patterns resolved? Sublime has a built in txt syntax mode, and I have a custom tmLanguage file in my User directory for CMakeLists.txt - but Sublime always seems to prefer the the more general txt match - it would be preferable if it took the best match (in terms of most characters matched I guess) rather than, as it appears to, the first one it comes across.


I'll put a fix in the next version so that it prefers full name matches over extension matches, as it should be.

adambowen wrote:(6) Is there a way to get Sublime to reload its settings without restarting? At the moment tweaking language definitions and configuration options is quite cumbersome because I have to restart to check the effects.


Changes to .tmLanguage files never get reloaded on the fly yet, unfortunately. Other configuration files should be reloaded immediately, but I've had reports they may not be if there are symlinks involved.

adambowen wrote:(7) For me, Ctrl+F, F3 appears to search backwards whilst Shift+F3 searches forwards (the Find and Find Prev buttons also appear to be reversed). I have not rebound any keys. I have no idea how I have managed this.


There's a 'Reverse Direction' button on the find panel you can click on revert this.
jps
Site Admin
 
Posts: 3077
Joined: Wed Mar 19, 2008 12:33 pm

Re: General Questions

Postby adambowen on Fri Mar 11, 2011 2:19 pm

Thanks for that, when I get a chance I'll try syncing the entire packages directory again. Previously the background of the tab bar would gradually fill with red (as though it wasn't being erased properly and new layers of transparency were being drawn on top). If I still have a problem I'll try to track down the exact cause for you.
adambowen
 
Posts: 3
Joined: Mon Feb 28, 2011 11:11 am


Return to General Discussion

Who is online

Users browsing this forum: Exabot [Bot] and 23 guests