New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indentation guides #264

Closed
PhilSDP opened this Issue May 11, 2015 · 7 comments

Comments

Projects
None yet
4 participants
@PhilSDP

PhilSDP commented May 11, 2015

I've noticed that the indentation guides in Komodo 9 (87208) are now static. In previous versions when the cursor was at the start or end of an indentation block that guide would turn red, very useful for matching long XML elements. I was hoping there was an option to enable this, but alas it does not appear so.

@cgchoffman

This comment has been minimized.

Member

cgchoffman commented May 11, 2015

Here's a work around using the following code as a macro in Komodo:

 var pref_name = ko.interpolate.interpolateStrings(["showMatchingTags_clearInterval"]);
if (pref_name) {
    var pref_value = 5000;
    if (pref_value !== null) {
        var prefs = Components.classes['@activestate.com/koPrefService;1'].getService(Components.interfaces.koIPrefService).prefs;
        //dump("Setting pref '" + pref_name + "' to '" + pref_value + "'\n");
        prefs.setLongPref(pref_name, parseInt(pref_value));
    }
}

Alternatively you could use this macro to have Komodo ask you how long you want the timeout to be:

var pref_name = ko.interpolate.interpolateStrings(["showMatchingTags_clearInterval"]);
var pref_value = ko.interpolate.interpolateStrings(["%(ask: Set timeout: -1 == no timeout)"]);
if (parseInt(pref_value)) {
    ko.prefs.setLong(pref_name, pref_value);
}

@cgchoffman cgchoffman added this to the 9.2 milestone May 11, 2015

@PhilSDP

This comment has been minimized.

PhilSDP commented May 12, 2015

Close, but no cigar. This highlights the corresponding open/close tags, which I agree is nice. But I was referring to the indentation guide itself (vertical line) is what used to change color. The tag highlights can be useful if both tags are displayed, but that's not always the case with long elements.

@PhilSDP

This comment has been minimized.

PhilSDP commented May 13, 2015

I see the difference, the guides do change color for matching braces {}, that is the behaviour that would be useful for XML tags too

@mitchell-as

This comment has been minimized.

Member

mitchell-as commented Jul 6, 2015

@PhilSDP Which version of Komodo had the indentation guide highlighting for HTML/XML tags? Neither Komodo 7.1.3 nor Komodo 8.5.4 had it. In fact, I'm not sure Komodo ever supported this feature.

It's worth pointing out that previous versions of Komodo did highlight indentation guides in red for brace characters. Either way, I'm going to mark this issue as an enhancement and add it to our backlog.

@mitchell-as mitchell-as modified the milestones: Backlog, 9.2 Jul 6, 2015

@PhilSDP

This comment has been minimized.

PhilSDP commented Jul 6, 2015

That is correct, it should be an enhancement as (indirectly) mentioned in my previous post when I referred to the braces "that would be useful for XML tags too", actually for any language that has open/close tags.

@mitchell-as

This comment has been minimized.

Member

mitchell-as commented Sep 20, 2016

Note to self: views-buffer.p.xml's doUpdateUI method calls scimoz.doMatchBrace(), which performs the usual brace matching. For XML/HTML, throw in a call to getMatchingTagInfo() (see an example later in that file) and if the tags have the same line indentation, brace match somewhere the start and end tags (scimoz.braceMatch()) and highlight the indent guide (scimoz.highlightGuide = ...).

@mitchell-as

This comment has been minimized.

Member

mitchell-as commented Oct 5, 2016

See also: e72d128 and b38f06e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment