Community
    • Login

    How to highlight the underlined squiggle words

    Scheduled Pinned Locked Moved General Discussion
    35 Posts 6 Posters 3.2k 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.
    • Michael VincentM
      Michael Vincent @Ekopalypse
      last edited by

      @Ekopalypse said in How to highlight the underlined squiggle words:

      logic below works

      Thanks. Converted to PerlScript:

      #!perl
      
      use strict;
      use warnings;
      
      use Win32::Mechanize::NotepadPlusPlus ':main';
      my $npp = notepad();
      
      my $indicator = 19;
      my $length    = editor->getLength();
      my $start     = editor->indicatorStart( $indicator, -1 );
      my $end       = editor->indicatorEnd( $indicator, -1 );
      
      my $real_start;
      
      if ( editor->indicatorValueAt( $indicator, $start ) ) {
          $real_start = $start;
      } else {
          $real_start = $end;
      }
      
      print "$start, $end, $length, $real_start\n";
      
      my $i = 100;
      while ( $real_start != $length ) {
          $i -= 1;
          if ( $i == 0 ) {
              print "ahhh endless loop - breaking\n";
              last;
          }
          $end = editor->indicatorEnd( $indicator, $real_start );
          print editor->getTextRange( $real_start, $end ); 
          print "\n";
          $real_start = editor->indicatorEnd( $indicator, $end );
      }
      

      It “works” but same issue, only finding the squigglies on screen. If I scroll down to some new squigglies, it only finds those on screen again (i.e., not the previous ones that were on screen but are no longer). Becoming more convinced this is a DSpellCheck optimization - only squiggly-ing the misspellings on screen.

      Cheers.

      EkopalypseE 2 Replies Last reply Reply Quote 2
      • EkopalypseE
        Ekopalypse @Michael Vincent
        last edited by

        @Michael-Vincent

        hmm, did the test using the mark indicator from find dialog,
        which worked, maybe I should have used/installed dspell plugin.
        Sorry for the noise.

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

          @Ekopalypse said in How to highlight the underlined squiggle words:

          Sorry for the noise.

          No noise at all! In fact you pretty much confirmed it’s a DSpellCheck optimization . I was going to get around to writing a script to add indicators but didn’t know the Find => Mark could do that. Using the same long file I’ve been testing on, I Find => Mark a word I know recurs over 100 times throughout the file and all my scripts (2 previous and the one I converted from your Python example) found more than just those indicators on screen in view.

          Cheers.

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

            I guess for a plugin like DSpellCheck it makes sense to do its work
            only for the current screen but on the other side it might be possible
            to do it in the background as well - but threading and scintilla and npp …
            maybe an async method would be safer.

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

              @Michael-Vincent said in How to highlight the underlined squiggle words:

              Becoming more convinced this is a DSpellCheck optimization

              I guess you are correct, as to this it checks only the visible area.

              1 Reply Last reply Reply Quote 2
              • Mia NguyenM
                Mia Nguyen
                last edited by

                Hi @all ,
                Me again another doubt. If the word is correct should be legitimate and I right clicked to add into Dictionary, it will be added into my own Npp only.
                Is there anyway after all i extract the plug in and gave it for other people so they can use on their own Npp ?

                PeterJonesP 1 Reply Last reply Reply Quote 0
                • PeterJonesP
                  PeterJones @Mia Nguyen
                  last edited by

                  @Mia-Nguyen said in How to highlight the underlined squiggle words:

                  Hi @all ,
                  Is there anyway after all i extract the plug in and gave it for other people so they can use on their own Npp ?

                  Assuming your language is US-English, it puts it into %AppData%\Notepad++\Plugins\Config\Hunspell\en_US.usr … thus, I would assume that it goes into that same folder, but with the appropriate language code (for whatever spelling language you have selected) as the file basename, with .usr as the extension. So you could distribute that file, which the other users can then merge with their dictionary (assuming they’ve also added words).

                  Mia NguyenM 1 Reply Last reply Reply Quote 3
                  • Mia NguyenM
                    Mia Nguyen @PeterJones
                    last edited by

                    @PeterJones If i send them my .usr file. Can they use directly or have to do anything to merge?

                    PeterJonesP 1 Reply Last reply Reply Quote 0
                    • PeterJonesP
                      PeterJones @Mia Nguyen
                      last edited by

                      @Mia-Nguyen said in How to highlight the underlined squiggle words:

                      @PeterJones If i send them my .usr file. Can they use directly or have to do anything to merge?

                      If they didn’t have any custom words yet, or if you can guarantee that your .usr file has every custom word they’ve already added, then they can just use your file directly. But if they save your .usr file overtop of their old one, then any custom words they had before would be lost.

                      Alan KilbornA 1 Reply Last reply Reply Quote 2
                      • Alan KilbornA
                        Alan Kilborn @PeterJones
                        last edited by

                        …any custom words they had before would be lost.

                        If the .usr file is in text format (don’t know, don’t use the spell-check plugin), perhaps the Compare plugin or a script to perform an automatic merge is called for. Just sayin.

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