Community
    • Login

    use plugin from macro

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    7 Posts 4 Posters 3.1k 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.
    • gfgtdfG
      gfgtdf
      last edited by

      I’m currently using the addon “indent by fold” to indent my lua code, however is indents lines that begin with ‘else’ incorrectly so i wrote a macro that fixed these mistakes with a regex replace.

      This means that i have to click 2 buttons to indent my code, which is annyoing does anyone know how i can extend my macro to call ‘indent by fold’ first?

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

        @gfgtdf

        to be honest - if you are programming lua why don’t you use the
        lua script plugin from dail and program your own indent routine or better check out his examples as far as I remember there was already an indent functionality developed?!

        Cheers
        Claudia

        Scott SumnerS 1 Reply Last reply Reply Quote 0
        • Scott SumnerS
          Scott Sumner @Claudia Frank
          last edited by

          @Claudia-Frank

          I believe you are talking about this posting?: https://notepad-plus-plus.org/community/topic/12741/auto-identation-in-lua-code-language

          1 Reply Last reply Reply Quote 1
          • gfgtdfG
            gfgtdf
            last edited by

            Thx to both of you, this was quite helpful.

            1 Reply Last reply Reply Quote 0
            • dailD
              dail
              last edited by

              @gfgtdf

              If you do plan on using that Lua code you probably instead want to use this slightly updated version of it. The post Claudia and Scott referenced was a very early version of it I put together real quick.

              1 Reply Last reply Reply Quote 0
              • gfgtdfG
                gfgtdf
                last edited by

                Thx again, i noticed though that the script cannot currectly indent functions that are passed as parmeters to other functions, in particular LuaAutoIndent.lua cannot correctly indent itself since it contain multiple lines like npp.AddEventHandler("OnSwitchFile", function(filename, bufferid) also it doesn’t indent correctly after the line if editor:findtext(increaseIndentPattern, SCFIND_REGEXP, start_pos, end_pos) then this is becasue the end in end_pos

                1 Reply Last reply Reply Quote 0
                • dailD
                  dail
                  last edited by

                  @gfgtdf

                  I never said it was perfect ;) You are welcome to make changes and submit a pull request.

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