AstroNvim / astrotheme

The default colorscheme used by AstroNvim
https://AstroNvim.com
GNU General Public License v3.0
107 stars 20 forks source link

Add support for lightspeed #31

Closed borisbrodski closed 1 year ago

borisbrodski commented 1 year ago

Without lightspeed highlight groups, it makes the plugin look like it's not working. Mainly because the plugin doesn't actually move the cursor while the search is happening, but uses highlight groups to make it look like the cursor is moving. We should get lightspeed highlight groups added to AstroTheme. ~ @mehalter

ORIGINAL ASTRONVIM BUG REPORT

Checklist

Operating system/version

Windows

Terminal/GUI

neovide, conemu, windows native

AstroNvim Health

astronvim: require("astronvim.health").check()

AstroNvim

Describe the bug

The cursor (and sometimes a part of the screen) doesn't get updated, when it should. Only after a subsequent keystroke the cursor jumps into place.

This is most notacable and disturbing, when using lightspeed or leap to jump. See reproduce section.

Steps to Reproduce

The bug is spotted at least in leap/lightspeed/fugitive plugins. It's always a missing refresh or redraw event.

The easiest to reproduce is with lightspeed:

  1. Install Astronvim on Windows following the instructions from https://astronvim.com/#%EF%B8%8F-installation
  2. Add %HOMEPATH%\AppData\Local\nvim\lua\user\init.lua with
return {
  plugins = {
    {
      "ggandor/lightspeed.nvim",
      lazy = false
    },
  },
}
  1. Run Nvim to install all plugs, then reopen nvim
  2. Open a new buffer, paste the following two lines of text

test123 test123


5. Place the cursor on the first line. It looks like

▋ test123 test123


6. Now press `s12`. The cursor should jump to the first `1`. But instead, the cursor stays on the first line. It looks like this:

▋ test123 test123s

The `s` at the end is the shortcut for the second `1`. Pressing `s` you would jump to the second `1`. 

7. Press `i` to go into INSERT mode, now the cursor moved to the currect possition.

test|123 test123

Alternativly, you could press `z`, that on its own has no effect. The cursor will jump to the correct position:

test▋23 test123



### Expected behavior

The cursor should always be rendered at its current position.

### Screenshots

_No response_

### Additional Context

With fugitive I have some part of the screen, that is not rendered properly. It happend after pressing `cc` in the `:G` (status) buffer to commit changes. The commit message buffer is missing the cursor and some ascii-draw characters.
mehalter commented 1 year ago

This is actually not what is happening. The cursor never moves, they "simulate" the cursor moving with highlight groups. This is just a side effect of AstroTheme not having support for lightspeed. I will transfer this to AstroTheme and reword the title to actually be a feature request on AstroTheme.

If you are curious, installing any lightspeed enabled theme will resolve the issue.

A-Lamia commented 1 year ago

We do have support for lightspeed, so let me do some tests and see what is happening. It may need some refactoring.