Community
    • Login

    Select all text on all open files?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 2 Posters 1.3k 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.
    • trespdaT
      trespda
      last edited by

      Is there a way to select all text on all open files?

      Is there a way to run a menu command on all of these selected texts?

      1 Reply Last reply Reply Quote 0
      • trespdaT
        trespda
        last edited by

        I’m looking blindly at the jN code

        URLDecoderEncoder.addItem({
            text: 'Decode',
            cmd: function() {
                var encoded = Editor.currentView.text;
                var unencoded = decodeURIComponent(encoded);
                Editor.currentView.text = unencoded;
            }
        

        , out of stackoverflow. They said there that Editor.currentView.text is the value that specify the text of the entire file. Can it be changed to be broader than currentView ?

        EkopalypseE 1 Reply Last reply Reply Quote 1
        • EkopalypseE
          Ekopalypse @trespda
          last edited by

          @trespda

          I’m not familiar with jn plugin but in order to get the text from all
          open documents you have to iterate over all open files.
          Npp offers an API to retrieve the open files.

          trespdaT 1 Reply Last reply Reply Quote 2
          • trespdaT
            trespda @Ekopalypse
            last edited by trespda

            @Ekopalypse

            Npp offers an API to retrieve the open files.

            Would this mean keeping the files as files in their tabs, or retrieving the texts from all files to a new file?

            1 Reply Last reply Reply Quote 1
            • EkopalypseE
              Ekopalypse
              last edited by

              Not quite sure I understand.
              The workflow is like this

              • get number of open files (NPPM_GETNBOPENFILES)
              • retrieve the bufferids for these files (NPPM_GETOPENFILENAMESPRIMARY/NPPM_GETOPENFILENAMESSECOND, NPPM_GETBUFFERIDFROMPOS)
              • activate the bufferids (NPPM_ACTIVATEDOC)
              • read the content (SCINTILLA API GetTextT)
              1 Reply Last reply Reply Quote 3
              • First post
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors