Community
    • Login

    Select text via syntax highlighting

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    11 Posts 4 Posters 802 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.
    • Alan KilbornA
      Alan Kilborn @dfdeboer
      last edited by

      @dfdeboer said in Select text via syntax highlighting:

      Can I now press a hot-key or right-click or something to select that entire URL?

      No.

      Or must I drag the mouse over the URL to select it?

      Yes.

      Perhaps something could be done with scripting to ease this situation.
      URLs are done with indicator #8.
      Maybe a script with execution tied to a keycombo could be run when the URL is pointed at.

      astrosofistaA 1 Reply Last reply Reply Quote 0
      • dfdeboerD
        dfdeboer
        last edited by

        Thanks Alan! I thought it might be as you describe, but OTH if I was missing something it should would have been nice to figure it out.

        1 Reply Last reply Reply Quote 0
        • astrosofistaA
          astrosofista @Alan Kilborn
          last edited by astrosofista

          Hi @Alan-Kilborn, @dfdeboer

          As long as URLs are quoted strings, there is already a Pythonscript available and a macro solution as well. Take a look at

          Copying quoted strings

          Have fun!

          Alan KilbornA 1 Reply Last reply Reply Quote 3
          • Alan KilbornA
            Alan Kilborn @astrosofista
            last edited by

            @astrosofista said in Select text via syntax highlighting:

            As long as URLs are quoted strings, there is already a Pythonscript available and a macro solution as well

            Yea, makes sense.
            For the current thread I was thinking more of a hover-based solution.
            But clicking somewhere inside the text and then running the script/macro is pretty reasonable.

            1 Reply Last reply Reply Quote 0
            • dfdeboerD
              dfdeboer
              last edited by

              Thanks astrosofista. I’ll probably try setting that up some day soon. (Must keep nose to grindstone and not get distracted by fun toys. . .)

              astrosofistaA 1 Reply Last reply Reply Quote 0
              • astrosofistaA
                astrosofista @dfdeboer
                last edited by

                Hi @dfdeboer

                You’re welcome. Glad to be of help.

                1 Reply Last reply Reply Quote 0
                • TroshinDVT
                  TroshinDV @dfdeboer
                  last edited by

                  This post is deleted!
                  1 Reply Last reply Reply Quote 0
                  • TroshinDVT
                    TroshinDV
                    last edited by

                    I am using jN plugin for such task.
                    https://github.com/sieukrem/jn-npp-plugin
                    The “href” selection functionality is in the file:
                    https://github.com/trdm/jn-npp-scripts/blob/master/includes/IntellHtml.js

                    TroshinDVT 2 Replies Last reply Reply Quote 0
                    • TroshinDVT
                      TroshinDV @TroshinDV
                      last edited by

                      @Дмитрий-Трошин said in Select text via syntax highlighting:

                      I am using jN plugin for such task.
                      https://github.com/sieukrem/jn-npp-plugin
                      The “href” selection functionality is in the file:
                      https://github.com/trdm/jn-npp-scripts/blob/master/includes/IntellHtml.js

                      function htmlMakeSelections(psAnaliser) {
                      	var rv = '';
                      	if(0) {
                      		psAnaliser = new CHtmlTagAnalizer;
                          }
                      	if(psAnaliser) {
                      		//debugger;
                      		var vPosStart = -1, vPosEnd = -1, vAnchor = 0, vPosOffset = -1;
                      		
                      		var vTag = null, vLP = psAnaliser.getLastPlasement();
                      		if(vLP && htmlNeedSelections(vLP)) {		
                      	    	var vTag = vLP.tag;
                      			var vNames = ['img']
                      	    	if( vTag && vTag.name == 'img' && vLP.atribName == "src") {        
                      				// select 'img'  or "src
                          	        var vAtrName = vTag.atribByPos(vLP.column);
                      		        if (vAtrName != '') {
                      		            vPosStart = vTag.atribPosStartVal(vAtrName)+1;
                      		            vPosEnd = vTag.atribPosEnd(vAtrName);
                      					/* bytePos/Pos и column связаны, */
                      					vPosOffset = view.pos - view.column;
                      					view.anchor = vPosStart + vPosOffset;
                      					view.pos = vPosEnd + vPosOffset;
                      		        }
                      		    }		
                              }    
                          }
                      	return rv;
                      }
                      
                      
                      1 Reply Last reply Reply Quote 1
                      • TroshinDVT
                        TroshinDV @TroshinDV
                        last edited by TroshinDV

                        @Дмитрий-Трошин said in Select text via syntax highlighting:

                        I am using jN plugin for such task.
                        https://github.com/sieukrem/jn-npp-plugin
                        The “href” selection functionality is in the file:
                        https://github.com/trdm/jn-npp-scripts/blob/master/includes/IntellHtml.js

                        How it works.
                        ![alt text](image url)

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