Skip to content

Moving around in insert mode triggers LSP completions; it shouldn’t #2027

@aral

Description

@aral

Summary

LSP completions should only be triggered while typing, not when moving around in LSP mode. Otherwise, it is very easy to corrupt code when using the up/down arrows to move between lines.

Reproduction Steps

For easier reproduction, set idle-timeout to 0 in your config.toml:

[editor]
idle-timeout = 0

Then, with the following basic JS example:

// Hello, World!
console.log('Hello, world')
  1. Go to line 2 (g2g)
  2. Enter insert mode (i)
  3. Press the right-arrow key three times then press the up-arrow key to get to the comment on line 1.

What should happen

The completion dialogue should not show and you should find yourself on line 1. The code on line 2 should remain unchanged.

What actually happens

The completion dialog shows and pressing the up arrow inserts the continue completion in the middle of the console keyword so you end up with:

// Hello, World!
continuensole.log('Hello, world')

Helix log

n/a

Platform

Linux (elementary OS 6; based on Ubuntu)

Terminal Emulator

io.elementary.t

Helix Version

helix 22.05-dev (2d4f94e)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-helix-termArea: Helix term improvementsC-bugCategory: This is a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions