GithubHelp home page GithubHelp logo

Comments (5)

luukvbaal avatar luukvbaal commented on September 22, 2024 1

I forgot that the current issue is that ext_cmdline is causing event inconsistencies, which should not be the expected behavior.

Why not? This event was intentionally removed in d41b8d4 (#27858). All it did is send an event placing the cursor in the current window. Which is unhelpful, because the cursor should be in the cmdline which is unknown to Nvim. Unlike when ext_cmdline is disabled where this event does place the cursor in the cmdline(message grid).

from neovim.

xiyaowong avatar xiyaowong commented on September 22, 2024 1

The potential issues may be related to the way UI events are handled. vscode-neovim currently only can adjust viewport based on cursor position rather than drawing.

However, the example I provided is indeed a special case, and the logic can be adjusted to solve it.

from neovim.

xiyaowong avatar xiyaowong commented on September 22, 2024
==== Disable ext_cmdline ===
### Start incsearch ###
['grid_cursor_goto', [1, 19, 2]]
['grid_scroll', [1, 3, 18, 3, 33, 11, 0]]
['win_viewport', [4, <Window(handle=1001)>, 11, 27, 25, 1, 27, 11]]
['grid_cursor_goto', [1, 19, 2]]
==== Enable ext_cmdline ===
### Start incsearch ###
['grid_scroll', [1, 3, 18, 3, 33, 11, 0]]
['win_viewport', [4, <Window(handle=1001)>, 11, 27, 25, 1, 27, 11]]

I printed out events related to scroll and viewport. It seems like this behavior is an intentional change in version 0.10? incsearch scrolls the window but doesn't move the cursor.

There should be relevant commits in the commit log.

I forgot that the current issue is that ext_cmdline is causing event inconsistencies, which should not be the expected behavior.

from neovim.

xiyaowong avatar xiyaowong commented on September 22, 2024

But the cursor is actually changed:

==== Disable ext_cmdline ===
cursor (1, 0)
### Start incsearch ###
grid_cursor_goto
grid_cursor_goto
cursor (26, 1)
==== Enable ext_cmdline ===
cursor (1, 0)
### Start incsearch ###
cursor (26, 1)
    def incsearch():
        nonlocal start_incsearch
        start_incsearch = True
        print('cursor', win.cursor)
        print("### Start incsearch ###")
        nvim.input("gg/e")
        print('cursor', win.cursor)

from neovim.

luukvbaal avatar luukvbaal commented on September 22, 2024

Well yes the cursor position in the current window changes for incsearch but the cursor position on the grid does not and should not(implicitly). What problem does this cause?

from neovim.

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.