Community
    • Login

    [New Plugin] Brackets Check

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    large filebracket
    7 Posts 5 Posters 20.4k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • niccordN
      niccord
      last edited by

      A plugin that helps you to check if brackets in your file are balanced.
      You can check all text in a file or only the part you selected.
      BracketsCheck Notepad++ Plugin

      Feel free to clone, create issues, branching and whatever you want.
      Spread the word, if you like it :)

      1 Reply Last reply Reply Quote 0
      • Kasper GraversenK
        Kasper Graversen
        last edited by Kasper Graversen

        Consider using the https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net as the foundation of your plugin. It a modernized version of the plugin code for C#. I’d be really interested if something is missing etc… ie. it is code that is actually being maintained ;)

        1 Reply Last reply Reply Quote 1
        • niccordN
          niccord
          last edited by

          The plugin have been updated.
          Version 1.2 includes brackets type parametrization and parameters save/load.

          BracketsCheck Notepad++ Plugin

          1 Reply Last reply Reply Quote 0
          • Matthew ToyM
            Matthew Toy
            last edited by

            Hi - I discovered this fantastically useful plugin a couple of months ago (writing basically TCL scripts in a for a crippled interpreter that won’t even give you a line number on error).

            It seems incompatible with the latest version of NP++, which offers disabling of the plugin on startup.

            Anybody an idea what the issue is?
            Thanks very much,
            Matthew

            Notepad++ v7.5.8 (32-bit)
            Build time : Jul 23 2018 - 02:03:53
            Path : M:\Notepad++\notepad++.exe
            Admin mode : ON
            Local Conf mode : ON
            OS : Windows 7 (32-bit)
            Plugins : DSpellCheck2.dll JSMinNPP.dll NppFTP.dll NppTextFX.dll PluginManager.dll Tidy2.dll DSpellCheck.dll mimeTools.dll NppConverter.dll NppExport.dll

            Claudia FrankC 1 Reply Last reply Reply Quote 0
            • Claudia FrankC
              Claudia Frank @Matthew Toy
              last edited by

              @Matthew-Toy

              what exactly is the error you get?
              Could it be that you try to load a 64bit plugin for a 32bit notepad++ application?

              Cheers
              Claudia

              1 Reply Last reply Reply Quote 1
              • Jesse BevilJ
                Jesse Bevil
                last edited by

                I had an issue with the saving of settings feature that was added. Seems that while it saved the settings to the INI correct, and updated the menu items correctly, it didn’t update the variables when the plugin loaded, which cause the Menu check boxes and the variables themselves to be out of sync with each other.

                The variables are initialized as true, however if they were unchecked and notepad++ was closed, and then opened again, they would be true but the menu would be unchecked. When the plugin is ran to check bracket, it acted as if all boxes were checked even though the menu showed them unchecked. I made a change and submitted a pull request to the GitHub. The change was made in Main.cs in the CommandMenuInit()

                internal static void CommandMenuInit()
                        {
                            PluginBase.InitiINI();
                            PluginBase.SetCommand(0, "Check Brackets: All text", checkBracketsAll);
                            PluginBase.SetCommand(1, "Check Brackets: Selected text", checkBracketsSelected);
                            PluginBase.SetCommand(2, "", null); // ----------------------------------
                            string checkRound = "Check round brackets";
                            string checkSquare = "Check square brackets";
                            string checkCurly = "Check curly brackets";
                            string checkAngle = "Check angle brackets";
                            PluginBase.SetCommand(3, checkRound, toggleCheckRoundBrackets, Win32.GetPrivateProfileInt(PluginName, checkRound, 1, PluginBase.IniFilePath) > 0);
                            if (Win32.GetPrivateProfileInt(PluginName, checkRound, 1, PluginBase.IniFilePath) < 1) checkRoundBrackets = false;
                            PluginBase.SetCommand(4, checkSquare, toggleCheckSquareBrackets, Win32.GetPrivateProfileInt(PluginName, checkSquare, 1, PluginBase.IniFilePath) > 0);
                            if (Win32.GetPrivateProfileInt(PluginName, checkSquare, 1, PluginBase.IniFilePath) < 1) checkSquareBrackets = false;
                            PluginBase.SetCommand(5, checkCurly, toggleCheckCurlyBrackets, Win32.GetPrivateProfileInt(PluginName, checkCurly, 1, PluginBase.IniFilePath) > 0);
                            if (Win32.GetPrivateProfileInt(PluginName, checkCurly, 1, PluginBase.IniFilePath) < 1) checkCurlyBrackets = false;
                            PluginBase.SetCommand(6, checkAngle, toggleCheckAngleBrackets, Win32.GetPrivateProfileInt(PluginName, checkAngle, 1, PluginBase.IniFilePath) > 0);
                            if (Win32.GetPrivateProfileInt(PluginName, checkAngle, 1, PluginBase.IniFilePath) < 1) checkAngleBrackets = false;
                        }
                

                I added simple if statement and get the value of the INI and if it’s less than 1 then set it to false.

                After doing some hunting and finding some missing files from the GitHub I managed to get this compiled and verified to now work as originally intended. Hopefully the author sees the pull request and gets it merged so that it appears correctly in the plugin manager.

                1 Reply Last reply Reply Quote 0
                • niccordN
                  niccord
                  last edited by

                  With the help of @Jesse-Bevil, version 1.2.1 has just been released with this bug fix.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post
                  The Community of users of the Notepad++ text editor.
                  Powered by NodeBB | Contributors