Menu

Change indent on a block of text

Gary
2008-10-09
2012-11-13
  • Gary

    Gary - 2008-10-09

    Is there a way to change the indetation on a block of text?

     
    • Tom

      Tom - 2008-10-09

      Yeah, highlight it and press tab (or shift+tab to decrease). It doesn't replace the text highlighted with a tab character like you might expect.

       
      • Gary

        Gary - 2008-10-09

        That's just too easy.  Thanks for the response!

         
    • Fabio

      Fabio - 2008-10-10

      Now that you mention it, there's a small bug about this feature. Here's how to reproduce it:
      Open a file and paste this code:

          for (j=0;j<N;j++) {
              if () {
                 
              }
              if () {
                 
              }
      }

      with THIS indentation (the important thing is that the final "}" has no indentation, and the rest does). If you select the entire block and press tab, the final bracket "}" will not move. If you shift-tab until the matching bracket has the same indentation (in other words, if you shift-tab until the "for" line has no indentation), then it works: press tab and you'll see the entire block shifting, including the "}" that was previously missing.

      I'm using 5.1 RC ANSI, but actually this bug has been around for a while. As far as I know, this bug might have been present since the first version of NPP. It's just so meaningless that I've actually never reported it, but now it has come to my mind. I don't think I'd ever waste my time fixing it if it took more than 5 minutes...

       
    • Fabio

      Fabio - 2008-10-10

      Damn, the forum has screwed up my indentation. Ok, I'll try it this way:

      (tab) for (j=0;j<N;j++) {
      (tab)(tab) if () {
      (tab)(tab)(tab)
      (tab)(tab)}
      (tab)(tab)if () {
      (tab)(tab)(tab)
      (tab)(tab)}
      }

      It's not very clear, but I wouldn't know how I could write it otherwise, sorry.

       
      • Daniel Spawn

        Daniel Spawn - 2008-10-10

        Nevermind, copy-pasting it works ok to replay the bug

         
    • Harry

      Harry - 2008-10-10

      I think Notepad++ uses Scintilla to handle the indentation, you might want to report the bug there.