Community
    • Login

    Reverse Lines

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    13 Posts 4 Posters 5.6k 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.
    • zhivkov007Z
      zhivkov007 @Michael Vincent
      last edited by

      This post is deleted!
      1 Reply Last reply Reply Quote 0
      • zhivkov007Z
        zhivkov007 @Michael Vincent
        last edited by

        @michael-vincent
        Ah, I see it is complied. Thanks!

        Alan KilbornA 1 Reply Last reply Reply Quote 0
        • Alan KilbornA
          Alan Kilborn @zhivkov007
          last edited by

          @djurzivk

          Is there some value in the plugin when the functionality is native in Notepad++?

          zhivkov007Z 2 Replies Last reply Reply Quote 0
          • zhivkov007Z
            zhivkov007 @Alan Kilborn
            last edited by

            @alan-kilborn
            This does not the same. This plugin inverts the text.
            text --> txet

            1 Reply Last reply Reply Quote 0
            • zhivkov007Z
              zhivkov007 @Alan Kilborn
              last edited by

              @alan-kilborn
              Ah you are right, it doesn’t reverse the text. Sorry for the confussion.
              @Michael-Vincent
              Yes, I need to reverse (selected) text, not lines.

              zhivkov007Z 1 Reply Last reply Reply Quote 0
              • zhivkov007Z
                zhivkov007 @zhivkov007
                last edited by

                This one
                https://github.com/mrt-prodz/NPP-Reverse-Text

                Alan KilbornA Michael VincentM 2 Replies Last reply Reply Quote 0
                • Alan KilbornA
                  Alan Kilborn @zhivkov007
                  last edited by

                  @djurzivk

                  If you are going to use a plugin, why not use PythonScript instead, example:

                  # -*- coding: utf-8 -*-
                  from __future__ import print_function
                  
                  from Npp import *
                  
                  (start_line, end_line) = editor.getUserLineSelection()
                  for line_nbr in range(start_line, end_line + 1):
                      line_contents = editor.getLine(line_nbr).rstrip("\n\r")
                      line_contents = line_contents[::-1]  # reverse string
                      print(line_contents)
                  
                  zhivkov007Z 1 Reply Last reply Reply Quote 0
                  • zhivkov007Z
                    zhivkov007 @Alan Kilborn
                    last edited by

                    @alan-kilborn
                    I can’t use Python. :(

                    1 Reply Last reply Reply Quote 0
                    • Michael VincentM
                      Michael Vincent @zhivkov007
                      last edited by

                      @zhivkov007 said in Reverse Lines:

                      This one
                      https://github.com/mrt-prodz/NPP-Reverse-Text

                      Looks like that plugin hasn’t been touched in 7+ years and with the changes to N++ / Scintilla API between now and then - AND the recent (January 2022) breaking changes regarding support for >2Gb files … and what this plugin does with “text ranges” - I’m going out on a limb (without testing the compilation myself) that compiling it may fail and even if it does compile, it certainly won’t work with current versions of Notepad++ without a serious overhaul.

                      That said, you don’t need to “know” Python to use @Alan-Kilborn 's script, you just need to install the PythonScript plugin.

                      Cheers.

                      F 1 Reply Last reply Reply Quote 1
                      • F
                        freezer2022 @Michael Vincent
                        last edited by freezer2022

                        @Michael-Vincent @zhivkov007 32bit version has been ported to a 64bit : https://github.com/mrt-prodz/NPP-Reverse-Text/issues/4

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