Community
    • Login

    Selected character and row count

    Scheduled Pinned Locked Moved General Discussion
    4 Posts 2 Posters 3.4k 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.
    • REVerdiR
      REVerdi
      last edited by

      Suggestion:
      if col==1 and lines>1 then lines=lines-1 and chars=chars-2 (CR+LF) or chars=chars-1 (LF or CR).

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA
        Alan Kilborn @REVerdi
        last edited by

        @REVerdi

        I think you are going to have to say a bit more on that before people are really going to understand your meaning…

        1 Reply Last reply Reply Quote 1
        • REVerdiR
          REVerdi
          last edited by

          OK, sorry! In fact, not to mention that the “pseudocode” is not correct.

          In the status bar of Notepad++, there is an indicator of the current row and column and of selected characters and rows. Something like

          Ln: 1 Col : 1 Sel 0 | 0

          If the selected text starts on one line and ends on another, the selected character count includes the hidden characters (CR+LF in Windows). In my opinion, they should not be counted.

          If the selected text starts on one line and ends on another, the line count includes the ending line, even if the caret is in column 1 of that line. In my opinion, if the caret is in column 1 of the final line, it should not be counted.

          I hope I have been clearer now.

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

            @REVerdi

            Your first point:

            the selected character count includes the hidden characters (CR+LF in Windows)…they should not be counted.

            Hmmm, guess I don’t see why they shouldn’t be included in the count; they are there, taking up space.

            I agree with you on your second point; see this thread I created a long time ago: https://notepad-plus-plus.org/community/topic/13087/sel-in-status-bar-is-off-by-1-on-line-count

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