Coder Social home page Coder Social logo

Comments (5)

aaxu avatar aaxu commented on May 10, 2024

Also a question: when I scroll the mouse wheel down (towards me), I expect the text buffer to scroll upward so I can see what is below my current view. Thus, I expect mouseWheelDown and scrollUp to be called. Is this not the case for you? The naming always confuses me LOL and I just want to make sure what's happening.

from ci_edit.

aaxu avatar aaxu commented on May 10, 2024

A few more questions:

  • When we scroll up/down, do we also want it to move the cursor or should the cursor/all selected text stay the same?
  • What is captive cursor?
    Sorry I just want to clarify all these things before changing them to make sure the design stays the same. This bug caused an error in my bookmarks so I want to track it down before finishing up and releasing the bookmarks implementation

from ci_edit.

dschuyler avatar dschuyler commented on May 10, 2024

Interesting effect/bug.

Which way is up

What is up vs. down is a long time debate in computer UI's. I've heard there were debates on it in Xerox PARC and Apple back when scrolling UIs were first done. With mouse wheels and touchpads the debate continued. IIUC, at the heart of the debate is whether the user is scrolling the cursor (focus) or whether they are scrolling the document. Now with touchpads, imo, a self evident decision has arrived because it's more intuitive for the screen to follow the user's finger (i.e. scrolling the document) when moving (rather than going the other way). Mac (and maybe others) have an OS option to reverse the scroll direction of a mouse wheel/trackpad. (Any of the above could be wrong, that's my memory of it off the top of my head).

Maybe app.prefs.editor['scrollDirection']

Maybe we should include an option to reverse the scroll direction.

Captive Cursor

Other console editors, such as vi, keep the cursor on the screen when scrolling. So if the window is scrolled away from the cursor, the cursor gets 'caught' by the window border and dragged along so that it stays on-screen* (what I call captive**). GUI editors don't tend to do that, they leave the cursor in-place within the document while the window scrolls.

ci initially acted more like a console editor

So when I started ci_edit, I kept the cursor on the screen and added a marker feature. After some time, I began to ask myself why, why was doing what had been done before and whether that was really the most intuitive design. When I made the cursor behave more like a GUI editor I decided not to remove the code that held the cursor 'captive' on the screen, so I put it behind a preference setting. I suspect (bet on) someone in the future having a desire for the captive cursor behavior, and thought it would be nice to offer it.

*For this reason a 'marker' feature is necessary to specify ranges of text for acting upon (like cut, or copy). Leaving the cursor in-place to mark a position doesn't work if the user wants to act on more than a screen full of text. Since GUI editors that leave the cursor in-place within the document, the cursor itself acts as the 'marker' so a separate marker concept/feature is not needed.

**I don't think 'captive' is an official term, I just needed something to call it and 'captive' filled the need for a name.

from ci_edit.

dschuyler avatar dschuyler commented on May 10, 2024

Also, confusingly (unless ya don't think about it, then it's fine)* a click-and-drag action actually reverses the scrolling behavior. This is because the scrolling paradigm changes from scrolling the document to scrolling the cursor (focus).

*UI scrolling is like walking. It's all fine unless ya think about it too much, then it becomes a complicated mess :).

from ci_edit.

aaxu avatar aaxu commented on May 10, 2024

Update: I think the main point of this PR is that scrolling when on the status line makes the textbuffer go in the opposite direction than if you scroll with the mouse on the main text buffer.

Edit:
By default, we have natural scrolling turned OFF, so scrolling up should show earlier lines.
Currently, scrolling up with the mouse on the message line/stats line makes the textbuffer scroll down (as if natural scrolling is turned ON)
Scrolling down with the mouse at this area makes the cursor go to the bottom of the document and all text in between gets highlighted.

from ci_edit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.