Navigation

    Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Selected character and row count

    General Discussion
    2
    4
    1091
    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.
    • REVerdi
      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 Kilborn 1 Reply Last reply Reply Quote 0
      • Alan Kilborn
        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
        • REVerdi
          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 Kilborn 1 Reply Last reply Reply Quote 1
          • Alan Kilborn
            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
            Copyright © 2014 NodeBB Forums | Contributors