【问题标题】:Fix Sublime Text 2 brackets matching with > 28 if()-tests?修复 Sublime Text 2 括号匹配 > 28 if()-tests?
【发布时间】:2016-10-06 15:31:02
【问题描述】:

当内部有超过 28 个 if() 语句或 28 个 {} 对时,我的 Sublime Text 2 编辑器不会自动匹配(大括号)括号。

当将数字减少到

  • 问题

无论if() / {} 对的数量如何,如何匹配括号?

  • 备选问题

哪个文本编辑器可以默认执行此操作?

对于那些想在 Sublime Text 2 中尝试限制的人,这里是我摆弄的代码:

function increment() {

    if (timeStamp > 21112) {
        $('#us').html("USA " + counterUSio + "/" + counterUSiorup + " " + "MW");
        counterUSio = 0;
        counterUSiorup = 0;
    }
    if (timeStamp > 33587) {
        $('#cn').html("CHN " + counterCNio + "/" + counterCNiorup + " " + "MW");
        counterCNio = 0;
        counterCNiorup = 0;
    }
    if (timeStamp > 19902) {
        $('#sr').html("RUS " + counterSRio + "/" + counterSRiorup + " " + "MW");
        counterSRio = 0;
        counterSRiorup = 0;
    }
    if (timeStamp > 42676) {
        $('#ae').html("AE " + counterAEio + "/" + counterAEiorup + " " + "MW");
        counterAEio = 0;
        counterAEiorup = 0;
    }
    if (timeStamp > 22449) {
        $('#de').html("DE " + counterDEio + "/" + counterDEiorup + " " + "MW");
        counterDEio = 0;
        counterDEiorup = 0;
    }
    if (timeStamp > 27107) {
        $('#ar').html("AR " + counterARio + "/" + counterARiorup + " " + "MW");
        counterARio = 0;
        counterARiorup = 0;
    }
    if (timeStamp > 28116) {
        $('#am').html("AM " + counterAMio + "/" + counterAMiorup + " " + "MW");
        counterAMio = 0;
        counterAMiorup = 0;
    }
    if (timeStamp > 22929) {
        $('#be').html("BE " + counterBEio + "/" + counterBEiorup + " " + "MW");
        counterBEio = 0;
        counterBEiorup = 0;
    }
    if (timeStamp > 27234) {
        $('#bg').html("BG " + counterBGio + "/" + counterBGiorup + " " + "MW");
        counterBGio = 0;
        counterBGiorup = 0;
    }
    if (timeStamp > 30042) {
        $('#br').html("BR " + counterBRio + "/" + counterBRiorup + " " + "MW");
        counterBRio = 0;
        counterBRiorup = 0;
    }
    if (timeStamp > 22801) {
        $('#ca').html("CA " + counterCAio + "/" + counterCAiorup + " " + "MW");
        counterCAio = 0;
        counterCAiorup = 0;
    }
    if (timeStamp > 24866) {
        $('#ch').html("CH " + counterCHio + "/" + counterCHiorup + " " + "MW");
        counterCHio = 0;
        counterCHiorup = 0;
    }
    if (timeStamp > 31102) {
        $('#cz').html("CZ " + counterCZio + "/" + counterCZiorup + " " + "MW");
        counterCZio = 0;
        counterCZiorup = 0;
    }
    if (timeStamp > 28164) {
        $('#fi').html("FI " + counterFIio + "/" + counterFIiorup + " " + "MW");
        counterFIio = 0;
        counterFIiorup = 0;
    }
    if (timeStamp > 21662) {
        $('#fr').html("FR " + counterFRio + "/" + counterFRiorup + " " + "MW");
        counterFRio = 0;
        counterFRiorup = 0;
    }
    if (timeStamp > 30313) {
        $('#hu').html("HU " + counterHUio + "/" + counterHUiorup + " " + "MW");
        counterHUio = 0;
        counterHUiorup = 0;
    }
    if (timeStamp > 25294) {
        $('#in').html("IN " + counterINio + "/" + counterINiorup + " " + "MW");
        counterINio = 0;
        counterINiorup = 0;
    }
    if (timeStamp > 40789) {
        $('#ir').html("IR " + counterIRio + "/" + counterIRiorup + " " + "MW");
        counterIRio = 0;
        counterIRiorup = 0;
    }
    if (timeStamp > 23143) {
        $('#it').html("IT " + counterITio + "/" + counterITiorup + " " + "MW");
        counterITio = 0;
        counterITiorup = 0;
    }
    if (timeStamp > 23310) {
        $('#jp').html("JP " + counterJPio + "/" + counterJPiorup + " " + "MW");
        counterJPio = 0;
        counterJPiorup = 0;
    }
    if (timeStamp > 26861) {
        $('#kz').html("KZ " + counterKZio + "/" + counterKZiorup + " " + "MW");
        counterKZio = 0;
        counterKZiorup = 0;
    }
    if (timeStamp > 28302) {
        $('#kr').html("KR " + counterKRio + "/" + counterKRiorup + " " + "MW");
        counterKRio = 0;
        counterKRiorup = 0;
    }
    if (timeStamp > 30681) {
        $('#lt').html("LT " + counterLTio + "/" + counterLTiorup + " " + "MW");
        counterLTio = 0;
        counterLTiorup = 0;
    }
    if (timeStamp > 32611) {
        $('#mx').html("MX " + counterMXio + "/" + counterMXiorup + " " + "MW");
        counterMXio = 0;
        counterMXiorup = 0;
    }
    if (timeStamp > 25129) {
        $('#nl').html("NL " + counterNLio + "/" + counterNLiorup + " " + "MW");
        counterNLio = 0;
        counterNLiorup = 0;
    }
    if (timeStamp > 26224) {
        $('#pk').html("PK " + counterPKio + "/" + counterPKiorup + " " + "MW");
        counterPKio = 0;
        counterPKiorup = 0;
    }
    if (timeStamp > 35257) {
        $('#ro').html("RO " + counterROio + "/" + counterROiorup + " " + "MW");
        counterROio = 0;
        counterROiorup = 0;
    }
    if (timeStamp > 35257) {
        $('#ro').html("RO " + counterROio + "/" + counterROiorup + " " + "MW");
        counterROio = 0;
        counterROiorup = 0;
    }
    if (timeStamp > 35257) {
        $('#ro').html("RO " + counterROio + "/" + counterROiorup + " " + "MW");
        counterROio = 0;
        counterROiorup = 0;
    }
    if (timeStamp > 35257) {
        $('#ro').html("RO " + counterROio + "/" + counterROiorup + " " + "MW");
        counterROio = 0;
        counterROiorup = 0;
    }
}

问候, 奈巴夫

【问题讨论】:

    标签: javascript if-statement sublimetext2 brackets


    【解决方案1】:

    用途:

    BracketHighlighter


    它有一个search_threshold 设置,允许您定义匹配括号对的最大字符数。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-05-09
      • 2014-07-20
      • 2012-08-29
      • 2012-08-07
      • 2016-12-21
      • 2013-01-25
      • 2018-03-06
      • 2012-12-11
      相关资源
      最近更新 更多