How to lock the cursor

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

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #1181
    m.a.k.
    Participant

    Hi all.
    I got a big problem with Multi Edit: Whenever i scroll up or down in the editing window by using the mouse wheel the cursor moves also up and down some lines. This is very annoying.
    Is there any possibility to lock the cursor, so that Multi Edit behaves like any other editor when I scroll the window?
    I tried to activate the option “Lock Cursor on V-Scroll”, but that doesn’t seem to change anything.
    I would be glad if someone could help me fix this problem.

    regards
    Markus

    #4295
    Carloche
    Participant

    This is something that has been brought up before and there are certain pros and cons to the different options here. In locking the cursor within its place in a file and allowing the cursor to be moved out of the editing window’s view, you then run the risk of scrolling through a file and seeing some code that needs changing and you start to type in said changes and it’s now editing elsewhere in the file where you left the cursor.

    The option to turn that on or off within Multi-Edit has been discussed, but I will have to defer to those in Development to answer the question of when or if it will be included as an option.

    #4296
    deleyd
    Participant

    That’s strange, when I scroll with center wheel the cursor stays in place while the text scrolls up or down underneath it. When done new text is entered at the new cursor position. I have a Logitech mouse with center wheel set to “Universal Scroll”.

    Same if I scroll via clicking on the vertical scroll bar. If you scroll via clicking on the vertical scroll bar does the cursor remain in place or is it bound to its position in the text?

    Could it be a mouse setting?

    #4298
    Carloche
    Participant

    David,

    The behavior you describe is the behavior you should be experiencing. I understand m.a.k. to be asking for a way that the cursor can be locked into position, and that by scrolling up or down (using the wheel mouse or the scrollbar) it actually goes off screen.

    #4304
    m.a.k.
    Participant

    If you scroll via clicking on the vertical scroll bar does the cursor remain in place or is it bound to its position in the text?[/quote:1rv8cn8l]

    Hi all.
    First of all thanks for your quick answers.
    But no, the cursor doesn’t remain in place even when I try to scroll via the scroll bars.
    I read the manual once more and as far as I understand it, the mentioned option “lock cursor on v-scroll” should just do that: locking the cursor when I scroll the window.
    Probably it’s a bug that the option doesn’t have any effect? Or am I doing something wrong?

    best regards
    m.a.k.

    #4307
    BrentStroh
    Participant

    As it stands right now, the cursor must remain in the visible window; it’s a design decision based on some of the ideas mentioned above, as I understand it.

    There’s no way to leave the cursor on line 11 of the file and scroll the viewable window down to line 2514 unless you split window or you’ve got a really big monitor.

    #4308
    ReidSweatman
    Participant

    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. :)

    #4313
    deleyd
    Participant

    The “Lock cursor on v-scroll” checkbox determines whether a TRUE or FALSE is passed as the first parameter to CMAC built-in fuction MEW_ScrollUp and MEW_ScrollDown.

    I tested those functions back in September and deduced that it made no difference whether TRUE or FALSE was passed.

    ([url:3enrozr9]http://www.multieditsoftware.com/forums/viewtopic.php?t=93[/url:3enrozr9])

    It appears from macros ScrollUp & ScrollDn in MeSys.s that if the first parameter to MEW_ScrollUp or MEW_ScrollDown is TRUE we expect the cursor to remain bound to its position in the text (at least until the cursor reaches the top or bottom of the window), but experiment shows it makes no difference, so “Lock cursor on v-scroll” checkbox has no effect.

    EDIT: Actually we expect the opposite, because the call negates the MoveCursor variable:[code:3enrozr9]Mew_ScrollUp( !MoveCursor, 1 );[/code:3enrozr9]

    #4314
    Michal Vodicka
    Participant

    Sorry, it has the effect Reid described in previous post. Works for me :-)

    Try both SCROLLUP and SCROLLDN macros with this options enabled and disabled and you should see a difference. If cursor is locked, the position in the file remains unchanged during scroll (until window border is reached). In opposite case cursor position in the window remains unchanged and position in file (line number) changes.

    #4315
    ReidSweatman
    Participant

    David, you’re correct that those are the macros involved. I would wager that you did your original testing using the mouse rather than the keyboard, which is the only way those macros are invoked in the interface. You could invoke them from a button or menu, but that doesn’t really seem to make sense. There might be use for them in macros, but I don’t think you’d get anything you can’t already get from the more common cursor movement macros.

    The key (sorry about that :) ) is that the toggle only makes a difference to those two macros, and the only way they will run is from the keyboard.

    #4318
    m.a.k.
    Participant

    Hi all.
    Thanks a lot for your very detailled answers. Apparently the program just behaves as it should do. That doesn’t solve my problem and I still don’t like the way the cursor acts, but anyway I know now that it is no bug, and it seems I have to arrange with it.

    best regards
    m.a.k.

    #4321
    ReidSweatman
    Participant

    Well, the easiest way to do what you want using existing functionality is to use the Marker Stack. Just press F4 to mark a location, and Shift-F4 to return to it (you can also play some macro tricks with the Marker Stack, as many of the system macros do). Since it’s a stack, each Shift-F4 returns you to the location where you pressed the last F4 and pops that marker. Once you get used to it, you’ll use it all the time.

    #4322
    m.a.k.
    Participant

    Well, the easiest way to do what you want using existing functionality is to use the Marker Stack. Just press F4 to mark a location, and Shift-F4 to return to it (you can also play some macro tricks with the Marker Stack, as many of the system macros do). Since it’s a stack, each Shift-F4 returns you to the location where you pressed the last F4 and pops that marker. Once you get used to it, you’ll use it all the time.[/quote:u0ytzhrt]

    Thanks for the hint. I’ll try it when I’m home again.

    greetings
    m.a.k.

    #4324
    deleyd
    Participant

    The ScrollUp macro works because after the call to MEW_SCROLLDOWN the code then manually fixes the cursor position:[code:3f7ld3rl] Mew_ScrollDown( !MoveCursor, 1 );
    if ( MoveCursor == 1 ) {
    if ( C_Row > 1 ) {
    Up;
    }
    }
    [/code:3f7ld3rl]The parameter to MEW_SCROLLDOWN has no effect.

    Similar with ScrollDn, which has at the end:[code:3f7ld3rl] Mew_ScrollUp( !MoveCursor, 1 );
    if ( MoveCursor == 1 ) {
    if ( C_Row < Win_CHeight ) {
    Down;
    }
    }
    [/code:3f7ld3rl]The parameter to MEW_SCROLLUP has no effect.

    #4326
    m.a.k.
    Participant

    mhh… isn’t there any way i can edit these macros and just prevent the cursor from going up or down one line?

Viewing 15 posts - 1 through 15 (of 18 total)
  • You must be logged in to reply to this topic.