Help save net neutrality! Learn more.
Close

#149 Specify indent size (and a few small fixes)

open
nobody
UI (101)
5
2012-11-13
2009-09-26
Simone
No

Hello,
I've been using Notepad++ for a long time (great job, really!) and recently I have made some small improvements to it, so I thought about sharing them with the other users. I hope I haven't made too many changes in a single patch, if necessary I can split it in smaller patches...
Here's what the patch does:
- Add the possibility to specify the indent size per file type (through the SCI_SETINDENT command). This is useful for example when a user wants to keep the tab size to 8 chars while setting the indent size to 2 or 4 chars.
- Add a menu command ("Add Tab") to allow inserting a tab char also when "convert tabs to spaces" is enabled. It should be probably considered to move and/or rename it, though.
- Move the _WIN32_IE macro definition to precompiledHeaders.h to avoid a Visual Studio 2008 compile error.
- Move the langs.xml file to the user data folder to allow its modification (needed when updating tab settings per file type)
- Solve a problem with changing the format to ANSI, the SCI_SETCODEPAGE command was not always called.

Discussion

  • Simone

    Simone - 2009-09-26
     
  • Don HO

    Don HO - 2009-10-07

    Could you give me an concrete example for the difference between TAB width and indent width?

    Don

     
  • Simone

    Simone - 2009-10-07

    For example, I recently had to work with source files which are indented with 4 spaces but which also contain tabs which must have the length of 8 spaces to align the text correctly. It's not very common but also not so rare, as it has already happened to me to find such code. Visual Studio, for example, allows to have separate settings for tab width and indent width, and I'm sure that other text editors can too, though I've never checked.

     
  • Sidde

    Sidde - 2010-03-12

    Hello,
    Is there any plan to implement this in any release in the near future?
    Right now this is the only thing stopping me from fully using this great editor. Since we have indent size 4 and tab size 8 as a style guide at work I either have to manually indent all files i work with or use another editor.

    Just like ilpippo said it's not very common but at least I'm seeing this style at more and more places so I'm sure there are people waiting for this fix (including more at my department).

    Keep up the good work...