Highlighting the current line in TextMate 2 - textmate

In TM 1.x, there was a preferences setting to enable the highlighting of the current line. This option seems to have disappeared in TM2. I assume there is some setting in tm_properties that can be set, but I cannot figure it out. I've tried setting lineHighlight to be a color, but this does not work. Has anyone figured this out?

It is not possible in TM2 yet, but there is an open ticket on github regarding this issue. The lead developer is assigned to it, however it doesn't seem to have that high priority.
Eventually you should be able to do like this:
settings = {
lineHighlight = '#FF483E';
};
This is from the Monokai Theme.

It's possible to set the colour for the current line in the line number and folding column on the left side of the window. Add the following after the first { in the beginning of the theme:
gutterSettings = {
foreground = '#BBBBBB';
background = '#333333';
divider = '#BBBBBB';
selectionBackground = '#FF8800';
selectionForeground = '#000000';
};

Related

Missing calls in the Chrome devtools js flamechart

Last time I was doing optimizations (maybe a year ago), I was able to see all possible function calls in the js flamechart.
Now, however, it doesn't seem to go all the way.
Here's a long running function:
I'm expecting way more sub-calls so that I may understand why is it running so long.
Here's how that function looks like:
function updateIfNeeded() {
switch (state) {
case 'NO_REQUEST':
throw new Error('Unexpected draw callback.\n' + 'Please report this to <https://github.com/elm-lang/virtual-dom/issues>.');
case 'PENDING_REQUEST':
rAF(updateIfNeeded);
state = 'EXTRA_REQUEST';
var nextNode = view(nextModel);
var patches = diff(currNode, nextNode);
domNode = applyPatches(domNode, currNode, patches, eventNode);
currNode = nextNode;
return;
case 'EXTRA_REQUEST':
state = 'NO_REQUEST';
return;
}
}
It's part of the elm-runtime.
Now, while it is possible that this function might not call any other functions, it would not explain why it's running for so long.
Where is the button for my complete flamechart :}
The Performance panel has a Disable JavaScript Samples checkbox in the capture settings menu.
When this checkbox is enabled, the timeline only shows the yellow placeholders to differentiate between script execution time and, layout, paint and composite activity.
Notice how the Cog/Settings Icon is red when the checkbox is enabled.
When the checkbox is not checked, the timeline shows the flame chart. When all the capture options are in their default state, the Cog/Settings Icon is blue while the menu is open and grey when the menu is closed/collaped.
Unfortunately it is not possible to be certain that this was the exact issue that you encountered, as the shared screenshot doesn't depict the capture settings.
Hopefully this knowledge proves valuable should you encounter the same behaviour in the future.

Change the colour of WinJS.UI.BackButton (Win 8.1 back button)

I'm getting started with Windows 8 App development using WinJS. I'm using the Light UI theme but I have set up a darker area on the left of the page (where the black back button is) and the issue is: you can't see the button.
I've trawled through the MSDN pages and the most I could find is how to style a button which doesn't actually explain how to change the colour of an actual asset.
http://msdn.microsoft.com/en-us/library/windows/apps/jj835822.aspx
I've also tried adding: win-ui-light and win-ui-dark classes to the button with no success.
I wondered if someone could point me in the right direction?
Many thanks for your time
Chris
First of all you have to delete the link tag that contain UI css by default and add it to document head , Dynamically.see below code :
var uistyle;
// call when your app load or resume.
function onappopen(){
uistyle = document.createElement('link');
uistyle.href = "//Microsoft.WinJS.2.0/css/ui-dark.css";
uistyle.rel = "stylesheet";
uistyle.id = "UIstyle";
document.head.appendChild(uistyle);}
// call when you want to change UI Style.
function UIstyle(UIbool){
if(UIbool=='light'){ uistyle.href = "//Microsoft.WinJS.2.0/css/ui-light.css";}
else {uistyle.href = "//Microsoft.WinJS.2.0/css/ui-dark.css";}}
Like: UIstyle('light'); for light UI in Windows 8 or "UIstyle()" for dark;
I used the DOM Explorer to find the buttons default values and overwrite them. It was the child element that needed to be overwritten: .win-back

Firefox extension: How can I set the cursor position?

I have a page with possibly several content-editable iframes (editors).
Now I would like to use my custom Firefox extension to do the following:
Setting the cursor to the end (or last HTML element) of the editor the cursor actually is in.
I found many solutions to get the cursor's position, but I need one to set it.
Any suggestions?
XPCOM likely includes such functionality as part of the testing rig. Mochitest at least is capable of this (again, probably though XPCOM).
On the other hand, when a user is on the system this a generally a gross violation of user interaction practices. Be sure you have a good justification for doing it. It may seem convenient but what if they're doing something else whilst using your addon? I usually have various apps open at once, Fx extensions are only part of that. I don't want it taking control of my mouse, EVER.
Is there something wrong with setting the focus? At least that only forces the user's hand at a window level.
It also suspect it make it quite difficult to get past AMO review. You'd have to justify why it was necessary to invoke such low-level functionality. If you interact with a window, for example, the window might be able to affect the input of your functions which in turn control the mouse... and then a random web site has access to the user's window!
Found the solution to my problem myself. This code myself will set the Cursor position to the last Paragraph of my editor:
var frame = window.content.document.getElementsByTagName('iframe')[2];
var win = frame.contentWindow;
var editingSession = Components.classes["#mozilla.org/editor/editingsession;1"].createInstance(Components.interfaces.nsIEditingSession);
var editor = editingSession.getEditorForWindow(win);
selection = window.getSelection();
var body = frame.contentDocument.body;
text = frame.contentDocument.createTextNode(".");
body.lastChild.appendChild(text); // add textnode to be selected
var range = editor.document.createRange();
range.setStartBefore(text);
range.setEndAfter(text);
editor.selection.removeAllRanges();
editor.selection.addRange(range);
body.lastChild.removeChild(text); // remove Child

Using VB6 & Janus Gridex - Anyone know how to highlight a single cell value?

Seems Janus doesn't think a developer might have a need to highlight the value of a single cell for the user...
It appears the SelStart & SelLength properties apply to the entire grid(wtf?)
I need to show a grid, and when the user enters the desired cell, to highlight the value for them for editing.. You know, highlight the value, start typing replaces the current value...
Should be like a simple txtBox.SelStart=0 & txtBox.SelLength=len(txtBox), But NO!!! Janus is WAY to smart for that...
Anyone out there smarter than Janus? Help!!
Thanks...
This works for me
GridEX1.SetFocus
GridEX1.Row = 2
GridEX1.Col = 3
GridEX1.EditMode = jgexEditModeOn
GridEX1.SelStart = 0
GridEX1.SelLength = 1000

Stop Xcode from converting text into hyperlinks?

I've got Xcode 3.2.1, and enjoy using it, but when I'm editing a file with hyperlinks in the text (for example, a comment with a reference: # see http://example.com) Xcode turns the text into a clickable hyperlink. This is a royal PITA when trying to edit that hyperlink, as it means I can't click inside it to edit a piece of the link -- I have to select it all and retype, or backspace/arrow-key eleventy-bajillion times to get to the part that needs changing.
Anyone know how to turn that off? I don't see it anywhere in the preferences, and have Googled until my fingers fell off, to no avail.
Dug a little further, and I found that Xcode 3.x hides its syntax highlighting rules in xclangspec files, so editing the appropriate file will allow you to change the rules to an extent.
Files are stored here:
/Developer/Library/PrivateFrameworks/XcodeEdit.framework/Versions/A/Resources
In that directory, I opened BaseSupport.xclangspec and found the line that identified the URL protocol:
Syntax = {
StartChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
Chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789;/:#&=+$,-_.!~*'()%#";
Match =
"^(acap|afp|afs|cid|data|fax|feed|file|ftp|go|gopher|http|https|imap|ldap|mailserver|mid|modem|news|nntp|opaquelocktoken|pop|prospero|rdar|rtsp|service|sip|soap\\.beep|soap\\.beeps|tel|telnet|tip|tn3270|urn|vemmi|wais|z39\\.50r|z39\\.50s)://([a-zA-Z0-9\\-_.]+/)?[a-zA-Z0-9;/?:#\\&=+$,\\-_.!~*'()%#]+$",
"^(mailto|im):[a-zA-Z0-9\\-_]+#[a-zA-Z0-9\\-_\\.!%]+$",
"^radar:[a-zA-Z0-9;/?:#\\&=+$,\\-_.!~*'()%#]+$",
); */
Type = "xcode.syntax.url";
};
and changed the line for Match = to read:
Match = ();
This eliminated URL matching, but not mailto matching (which is in a separate rule below the first). I'm leaving that as an exercise for the reader ;-)
Obviously, I could have been more selective, and I suspect that changing the Type line would be sufficient as well. Also, future versions of Xcode will likely overwrite this change, so I'll have to investigate putting the change into my own copy of BaseSupport.xclangspec and see if sticking it in ~/Library/Application Support works.
Use the option key when selecting text in the link or more drastically, turn off syntax highlighting for the file.
For anyone coming here for Xcode 7, things have changed a bit since #Zee's original posting.
For starters, the BaseSupport.xclangspec file is now located /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources.
Secondly, you must also modify the Built-in Syntax Types.xcsynspec file, which is in the same directory as BaseSupport.xclangspec. After opening this file, go down to the comment MARK: URLs and get rid of the url identifiers.
For safety purposes, I would recommend just commenting:
// MARK: URLs
//{
// Identifier = "xcode.syntax.url";
// Name = "URLs";
// Color = "0.055 0.055 1.000";
// IncludeInPrefs = YES;
// IsLink = YES;
// URLFormat = "%#";
//},
//{
// Identifier = "xcode.syntax.url.mail";
// BasedOn = "xcode.syntax.url";
// Color = "0.055 0.055 1.000";
// IncludeInPrefs = NO;
// IsLink = YES;
// URLFormat = "mailto:%#";
//},

Resources