Reply To: How to lock the cursor

Product Compare Forums Multi-Edit Support How to lock the cursor Reply To: How to lock the cursor


There’s nothing broken; it’s just that the Lock cursor on v-scroll checkbox doesn’t do what you think it might. It doesn’t relate to moving the cursor or doing anything with the Windows scroll bars at all.

The use of the word “scroll” in this context is unfortunate, but if you understand the historical reasons for it, it makes sense. The v-scroll toggle predates any Windows version of Multi-Edit, and in the absence of a GUI with scroll bars, “scrolling” has a somewhat different meaning. When the first Windows version of Multi-Edit came out, it kept that nomenclature.

There are two completely different, but related kinds of text/cursor-moving functions in Multi-Edit. The first sort, which you’re most familiar with, moves the cursor over the text, scrolling the text as necessary to keep the cursor in view. This is what you get when you press the Up and Down arrow keys, or click in the window to position the cursor.

The second sort moves the text, rather than the cursor. Now, while this is what any action you can perform with the mouse on a scroll bar or using the mouse wheel does, the actions available using only the keyboard are somewhat different. In particular, if you use the Scroll Window Down and Scroll Window Up functions (Ctrl-Up and Ctrl-Down in the default keymap), there are a couple of reasonable options for cursor behavior, always with the caveat that the cursor must remain on screen. You can keep the cursor either where it was in the text, or where it was in the window. That’s the behavior Lock cursor on v-scroll governs.

Now, there are a couple of caveats. First, the cursor must always be visible in the window. That design decision was made long ago, and while it may seem at odds with standard Windows behavior, remember that Windows didn’t even exist at the time. In any event, there are a number of valid reasons for having it work as it does, and much code has been written under that assumption in the interim. The upshot of this is simply that no matter where the cursor tries to stay during a scroll, if it collides with a window boundary, or reaches the start or end of the file, it will move to stay on screen.

Second, the Restrict cursor checkbox immediately above the Lock cursor on v-scroll one also affects cursor positioning, by preventing the cursor from ever being past the end of the text on a line or beyond the end of the file. If this is enabled, your cursor movement may seem somewhat erratic at times.

How you choose to set these checkboxes is strictly a personal preference. Many users are unaware of the keyboard text-scrolling combos, which can be quite useful, if you’re not a mouse-oriented person. It’s worth skimming the list of functions in the Command Mapping dialog, as there are many more pre-configured functions there than most people ever suspect, which you can assign to keys, menu items, or toolbar buttons. Further, if you edit any item in that dialog, you can see exactly what command line it executes; often, it will only be one of a host of different options that are possible. We couldn’t put everything in there. :)