Menu

[SUGGESTION] Real line width limit (tabs)

2008-03-28
2012-11-13
  • Nobody/Anonymous

    Hi,

    As always, thanks again for this great editor :)

    Here is my today's thought: NPP has a great feature of highlighting charcaters which go beyond the XXth. That's cool when you do not want to write beyond 80 for example, not to have problem when sending by mail or things like that.

    But this feature is not correct, as it counts columns, not actual chars. Tabs are one char but can take many columns. Anyway they should be counted as on char in the total amount. Thus, the "line mode" for showing the limit would look weird, but at least would it be exact. The "color mode" would probably be the most useful then.

    Thanks for reading, see you soon!

     
    • Nobody/Anonymous

      No, you got it totally wrong. Tabs must _always_ be counted by the number of columns they represent. In fact, this is where the Text FX features, like sorting, go wrong. They do count actual characters instead of columns, which makes it hard or even impossible to sort data layouted by tabs by any column not being the first. This is something more editors suffer from. It's a pain, really.

       
      • Derik DeVecchio

        Derik DeVecchio - 2008-08-07

        So wait.  This thread suggests that there is currently some way in NPP to highlight characters in lines that go beyond a certain length? or provide a "line" where the length is?  The latter would be kind of weird since I use different font sizes for end of line comments.

        If so, what is this method?

         
    • Nobody/Anonymous

      If you really need the absolute number of characters instead of columns, I suggest you replace your TAB characters by a specific single (column) character to check your desired line lengths. You can re-place the tabs afterwards.

       
    • Nobody/Anonymous

      Hum, well I do not agree with previous answers ;)

      Tab width depends on user choice. Say I use a 4-space tab, and you a 6-space tab. When you'll get my code, perfectly fiting into my 80-char wide screen, it won't fit into yours for the large lines! Although I really understand what you mean about counting and sorting, I think my complaint is different, it's just about line width. Tab doesn't have a standard width, so I'm afraid we won't ever solve this problem. Actually, tabs do not even have a fixed width but brings you to the next virtual column start.

      So there my not be any solution for nicely limiting a line width to 80 chars as long as it will contain tabs.

      And changing the tabs into spaces won't help as I need to get tab at the end ;)

       
      • Fool4UAnyway

        Fool4UAnyway - 2008-03-30

        Hey, I don't want my lines to be 80 characters long, but only 75.

        See the problem? Just as tabs can have a common width, so can lines.
        I assume you use your settings, and I'll use mine.

        Could the Text FX features be of any help to you?

        If I'm correct, you only have a problem then with the only tab at the end of a line crossing your 80-character limit?