• Login
Community
  • Login

Need a setting to treat visible lines as "physical" ones.

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
text editingnavigationline wrap
8 Posts 4 Posters 596 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.
  • A
    Aleksandr Okunev
    last edited by Sep 29, 2020, 1:42 PM

    Good day,
    I use Notepad++ for text editing, and the default view is “wrap text”.
    Very often the sentence is wrapped into several lines.
    Navigating such a sentence using Home and End keys is not similar to MS Word, where a chunk of wrapped long sentence is regarded as a separate line, in Notepad++ pressing End key takes me to the very end of the sentence or even paragraph while I needed to get to the right edge of the workspace.

    Have I overlooked a setting which switches on the behavior I need?

    Thank you.

    A P 2 Replies Last reply Sep 29, 2020, 1:49 PM Reply Quote 0
    • A
      Alan Kilborn @Aleksandr Okunev
      last edited by Sep 29, 2020, 1:49 PM

      @Aleksandr-Okunev

      I haven’t had a need recently, but I think mapping some of these in the Shortcut Mapper can provide the needed functionality:

      399a44be-579f-48dd-8094-22bbbe23930d-image.png

      1 Reply Last reply Reply Quote 1
      • P
        PeterJones @Aleksandr Okunev
        last edited by Sep 29, 2020, 1:54 PM

        @Aleksandr-Okunev ,

        I am a bit confused. The default behavior of the END key (using SCI_LINEENDWRAP in Shortcut Mapper > Scintilla Commands) will take you to the end of the visible line the first time you hit END; the second time you hit END, it goes to the end of the wrapped line.

        Based on my understanding, you want the END key to take you to the end of the visible line, which it will.

        Unless I’ve misunderstood you.

        But as @Alan-Kilborn said, there are lots of variants of the Scintilla commands, and you can change the keyboard mapping, so you can make the keys do what you want. The Scintilla Docs will explain the technicalities of each of those SCI_... names.

        1 Reply Last reply Reply Quote 1
        • A
          Aleksandr Okunev
          last edited by Sep 29, 2020, 5:00 PM

          Thanks everyone for your responses.

          Yes I posted misleading data.

          My problem is with Shift+Home and Shift+End, which I use to select the text.

          If I place the cursor in the middle of the “visible” line which is a part of a sentence which makes several “visible” lines, and my intended selection ends at the end of the current visible line, when I hold Shift and press End, the entire “physical” line is selected, up to the hard return, and not my intended selection.

          Same with Shift+Home, instead of selecting text up to the left edge of the work space, the editor selects several “visible” lines up to the previous hard return.

          A 1 Reply Last reply Sep 29, 2020, 5:12 PM Reply Quote 0
          • A
            Alan Kilborn @Aleksandr Okunev
            last edited by Alan Kilborn Sep 29, 2020, 5:15 PM Sep 29, 2020, 5:12 PM

            @Aleksandr-Okunev

            Well, my current setup works exactly as you describe you want yours to.
            And trying a “fresh” Notepad++, that’s exactly how it works as well.

            So if you need further help on this, I’d suggest you show a screenshot of the area of the Shortcut Mapper I showed previously, but include the area to the right – the actual keybindings – for your setup, which mine does not show.

            1 Reply Last reply Reply Quote 1
            • G
              guy038
              last edited by guy038 Sep 30, 2020, 4:40 PM Sep 30, 2020, 4:38 PM

              Hello, @aleksandr-okunev, @Peterjones, @Alan-kilborn and All,

              @aleksandr-okunev, as you’re mainly using the Word wrap mode, I suppose that you would like commands which move to the very beginning and to the very end of current line

              Here is a table which recapitulates all Scintilla actions relating to beginning and end of current line :

              •---------------------------------------------------------------------------------------------------------------------------------------------------------•
              |                         Different SCINTILLA messages about NAVIGATION, NORMAL and RECTANGULAR selection within CURRENT line                             |
              •------•----------------------------•--------•----------------------•-------------------------------------------------------------------------------------•
              | Num. |     SCINTILLA message      |   Id.  |   DEFAULT shortcut   |                           ACTION of the SCINTILLA message                           |
              •------•----------------------------•--------•----------------------•-------------------------------------------------------------------------------------•
              |  51  |  SCI_HOME                  |  2312  |                      |  Start of DOCUMENT line                                                             |
              |  52  |  SCI_HOMEEXTEND            |  2313  |                      |  STREAM selection      to start of DOCUMENT line                                    |
              |  53  |  SCI_HOMERECTEXTEND        |  2430  |                      |  RECTANGULAR selection to start of DOCUMENT line                                    |
              |      |                            |        |                      |                                                                                     |
              |  58  |  SCI_VCHOME                |  2331  |                      |  Start of first NON-BLANK char <-> Start of DOCUMENT line                           |
              |  xx  |  SCI_VCHOMEEXTEND          |  2332  |     NOT LISTED       |  STREAM selection to ...                                                            |
              |      |                            |        |                      |                                                                                     |
              |  56  |  SCI_HOMEWRAP              |  2349  |                      |  Start of DISPLAY line -> Start of DOCUMENT line                                    |
              |  57  |  SCI_HOMEWRAPEXTEND        |  2450  |                      |  STREAM selection to ...                                                            |
              |      |                            |        |                      |                                                                                     |
              |  61  |  SCI_VCHOMEWRAP            |  2453  |  Home                |  Start of DISPLAY line -> First NON-BLANK char <-> Start of DOCUMENT line           |
              |  59  |  SCI_VCHOMEWRAPEXTEND      |  2454  |  Shift + Home        |  STREAM selection to ...                                                            |
              |  60  |  SCI_VCHOMERECTEXTEND      |  2431  |  Alt + Shift + Home  |  RECTANGULAR selection to ...                                                       |
              |      |                            |        |                      |                                                                                     |
              |  54  |  SCI_HOMEDISPLAY           |  2345  |  Alt + Home          |  Start of DISPLAY line                                                              |
              |  55  |  SCI_HOMEDISPLAYEXTEND     |  2346  |                      |  STREAM selection to start of DISPLAY line                                          |
              |      |                            |        |                      |                                                                                     |
              |  xx  |  SCI_VCHOMEDISPLAY         |  2652  |     NOT LISTED       |  Start of DISPLAY line OR start of first NON-BLANK char <-> Start of DOCUMENT line  |
              |  xx  |  SCI_VCHOMEDISPLAYEXTEND   |  2653  |     NOT LISTED       |  STREAM selection to ...                                                            |
              •------•----------------------------•--------•----------------------•-------------------------------------------------------------------------------------•
              |  62  |  SCI_LINEEND               |  2314  |                      |  End of DOCUMENT line                                                               |
              |  68  |  SCI_LINEENDEXTEND         |  2315  |                      |  STREAM selection      to end of DOCUMENT line                                      |
              |  64  |  SCI_LINEENDRECTEXTEND     |  2432  |  Alt + Shift + End   |  RECTANGULAR selection to end of DOCUMENT line                                      |
              |      |                            |        |                      |                                                                                     |
              |  67  |  SCI_LINEENDWRAP           |  2451  |  End                 |  End of DISPLAY line -> End of DOCUMENT line                                        |
              |  63  |  SCI_LINEENDWRAPEXTEND     |  2452  |  Shift + End         |  STREAM selection to ...                                                            |
              |      |                            |        |                      |                                                                                     |
              |  65  |  SCI_LINEENDDISPLAY        |  2347  |  Alt + End           |  End of DISPLAY line                                                                |
              |  66  |  SCI_LINEENDDISPLAYEXTEND  |  2348  |                      |  STREAM selection to end of DISPLAY line                                            |
              •------•----------------------------•--------•----------------------•-------------------------------------------------------------------------------------•
              

              For additional information, refer to :

              https://www.scintilla.org/ScintillaDoc.html#KeyboardCommands


              Notes :

              • In case a wrapped line, the Scintilla documentation speak of :

                • Display line, to name each line of this wrapped line

                • Document line, to name the wrapped line, itself

              • Personally, I prefer to speak of physical lines for each line and of logical line to refer to the wrapped line, itself. Just my preference ;-)

              • In the table, above, 3 Scintilla commands are not listed in the Scintilla Commands tab of the N++ Shortcut Mapper. So they cannot be stored as Scintilla commands in your active Shortcut.xml file. Luckily, you can define these messages in a new Macro, located in the <Macros> node, then assign the appropriate shortcuts to each macro !

                      <Macro name="SCI_VCHOMEEXTEND" Ctrl="yes/no" Alt="yes/no" Shift="yes/no" Key="0">
                          <Action type="0" message="2332" wParam="0"  lParam="0"  sParam="" />
                      </Macro>
              
                      <Macro name="SCI_VCHOMEDISPLAY" Ctrl="yes/no" Alt="yes/no" Shift="yes/no" Key="0">
                          <Action type="0" message="2652" wParam="0"  lParam="0"  sParam="" />
                      </Macro>
              
                      <Macro name="SCI_VCHOMEDISPLAYEXTEND" Ctrl="yes/no" Alt="yes/no" Shift="yes/no" Key="0">
                          <Action type="0" message="2653" wParam="0"  lParam="0"  sParam="" />
                      </Macro>
              

              So, from this table, @aleksandr-okunev, here is the road map of the actions to do in the Scintilla commands tab of the Shortcut Mapper

              • Delete the shortcut of line 61 and assign the Home shortcut to line 51

              • Delete the shortcut of line 59 and assign the Shift + Home shortcut to line 52

              • Delete the shortcut of line 60 and assign the Alt + Shift + Home shortcut to line 53

              • Delete the shortcut of line 67 and assign the End shortcut to line 62

              • Delete the shortcut of line 63 and assign the Shift + End shortcut to line 68

              Hope this helps !

              Best Regards,

              guy038

              1 Reply Last reply Reply Quote 2
              • A
                Aleksandr Okunev
                last edited by Oct 1, 2020, 9:27 PM

                Thanks everyone.
                I use a very old version.
                I will upgrade and come back with the results.
                Stay safe and have fun! :-)

                1 Reply Last reply Reply Quote 1
                • A
                  Aleksandr Okunev
                  last edited by Oct 2, 2020, 7:52 AM

                  I upgraded from version 5.x to the latest version (I wish the best of luck to HK people, and doom to evil commies), and the text selection is indeed exactly what I need and exactly as it is in MS Word.
                  Thanks a lot, everyone, stay safe and have a great weekend.
                  :^)

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