Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single 'd' deletes the line under cursor #460

Closed
h0tbird opened this issue Apr 7, 2017 · 22 comments
Closed

Single 'd' deletes the line under cursor #460

h0tbird opened this issue Apr 7, 2017 · 22 comments

Comments

@h0tbird
Copy link

h0tbird commented Apr 7, 2017

Problems summary

I am a new user. The behavior described below happens after enabling deoplete:
In normal mode (after insert) dd is not working as expected.
A single d will delete the line under the cursor.

Expected

I expect the line to be deleted after I type dd.

Environment Information

  • deoplete version(SHA1):
[vim@arch deoplete.nvim]$ git rev-parse HEAD
be8d03e547c5bbc00b93c453b04a64a767baba3f
  • OS:
[vim@arch deoplete.nvim]$ cat /etc/os-release 
NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
ID_LIKE=archlinux
ANSI_COLOR="0;36"
HOME_URL="https://www.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://bugs.archlinux.org/"
  • neovim version:
[vim@arch deoplete.nvim]$ nvim --version
NVIM 0.1.7
Build type: Release
Compilation: /usr/bin/cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -Wconversion -O2 -DNDEBUG -DDISABLE_LOG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -DHAVE_CONFIG_H -D_GNU_SOURCE -I/build/neovim/src/build/config -I/build/neovim/src/neovim-0.1.7/src -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/build/neovim/src/build/src/nvim/auto -I/build/neovim/src/build/include
Compiled by builduser

Optional features included (+) or not (-): +acl   +iconv    +jemalloc +tui      
For differences from Vim, see :help vim-differences

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"
  • :CheckHealth result(neovim ver.0.1.5-452+):
health#deoplete#check
========================================================================
## deoplete.nvim
  - SUCCESS: has("nvim") was successful
  - SUCCESS: has("python3") was successful
  - INFO: If you're still having problems, try the following commands:
    $ export NVIM_PYTHON_LOG_FILE=/tmp/log
    $ export NVIM_PYTHON_LOG_LEVEL=DEBUG
    $ nvim
    $ cat /tmp/log_{PID}
    and then create an issue on github

health#nvim#check
========================================================================
## Configuration
  - SUCCESS: no issues found

## Performance
  - SUCCESS: Build type: Release

## Remote Plugins
  - SUCCESS: Up to date

## terminfo
  - INFO: key_backspace terminfo entry: key_backspace=\177,

health#provider#check
========================================================================
## Clipboard
  - WARNING: No clipboard tool found. Using the system clipboard won't work.
    - SUGGESTIONS:
      - See clipboard.

## Python 2 provider
  - INFO: `g:python_host_prog` is not set.  Searching for python2 in the environment.
  - INFO: Executable: /usr/bin/python2
  - INFO: Python2 version: 2.7.13
  - INFO: python2-neovim version: 0.1.13
  - SUCCESS: Latest python2-neovim is installed: 0.1.13

## Python 3 provider
  - INFO: `g:python3_host_prog` is not set.  Searching for python3 in the environment.
  - INFO: Executable: /usr/bin/python3
  - INFO: Python3 version: 3.6.0
  - INFO: python3-neovim version: 0.1.13
  - SUCCESS: Latest python3-neovim is installed: 0.1.13

## Ruby provider
  - SUCCESS: Found up-to-date neovim RubyGem
  - INFO: Ruby Version: ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]
  - INFO: Host Executable: /home/vim/.gem/ruby/2.4.0/bin/neovim-ruby-host
  - INFO: Host Version: 0.3.3

Provide a minimal init.vim with less than 50 lines (Required!)

call plug#begin('~/.local/share/nvim/plugged')
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
call plug#end()

let g:deoplete#enable_at_startup = 1

The reproduce ways from neovim starting (Required!)

  1. Edit a multi-line file.
  2. Enter insert mode.
  3. Enter normal mode.
  4. Delete one line by typing a single d.
@n8henrie
Copy link

n8henrie commented Apr 7, 2017

I have been debugging what I think is the same issue since yesterday. For me, I noticed that replacing a word with ciw stopped working, and afterwards a single c clears the entire line. I can also reproduce the behavior described above with d.

I noticed the bug was not there when I checked out tag 2.0, so I ran a quick git bisect, which shows:

df577eeaab20f5cc63dd8e7f0e8e46833766b8d1 is the first bad commit

df577ee

@h0tbird
Copy link
Author

h0tbird commented Apr 7, 2017

Right! tags/2.0 works for me too.

@PrestonKnopp
Copy link

PrestonKnopp commented Apr 9, 2017

I am also experiencing this issue, so far only after Ctrl-c from insert to normal mode. I know that Ctrl-c does not emit the InsertLeave event which might be messing something up.

Also, I did a clean install two days ago and Deoplete was definitely working before then.

@Shougo
Copy link
Owner

Shougo commented Apr 9, 2017

I cannot reproduce the problem in neovim 0.2.0.
I think you use neovim 0.1.7.
Please try neovim latest version.

@Shougo
Copy link
Owner

Shougo commented Apr 9, 2017

I am also experiencing this issue, so far only after Ctrl-c from insert to normal mode. I know that Ctrl-c does not emit the InsertLeave event which might be messing something up.

OK. I get it.
Please don't use <C-c> to restore to the normal mode.

@Shougo Shougo closed this as completed Apr 9, 2017
@n8henrie
Copy link

n8henrie commented Apr 9, 2017

It looks like 0.1.7 is still the latest release and 0.2.0 is still pre-release.

Shougo added a commit that referenced this issue Apr 9, 2017
@Shougo
Copy link
Owner

Shougo commented Apr 9, 2017

I have fixed the problem. But... please don't use <C-c> in insert mode.
It does not trigger InsertLeave autocommand.

@PrestonKnopp
Copy link

Okay cool. Thanks Shougo!

Oh, and I'm trying not to. Currently retraining my hands to use <C-[>.

@n8henrie
Copy link

I have fixed the problem.

It looks like 9a3c2ec did indeed fix the problem, but it has been reintroduced by the very next commit, bda6d16 (according to another git bisect).

@Shougo Shougo reopened this Apr 27, 2017
@Shougo Shougo closed this as completed in 76dfa1a Apr 30, 2017
@h0tbird
Copy link
Author

h0tbird commented Apr 30, 2017

So it won't work if we use <C-c>?

@Shougo
Copy link
Owner

Shougo commented Apr 30, 2017

So it won't work if we use <C-c>?

It breaks some plugins state.
You should not use the mapping.

@shri3k
Copy link

shri3k commented May 1, 2017

It breaks some plugins state.
You should not use the mapping.

I understand the limitation but this is kind of deal breaker. 😞

@Shougo
Copy link
Owner

Shougo commented May 2, 2017

You can use the mapping.

inoremap <C-c>  <Esc>

It works.

@shri3k
Copy link

shri3k commented May 3, 2017

heh. of course but it'd definitely confuse people who's trying to use my vim config for sure.

@n8henrie
Copy link

n8henrie commented May 4, 2017

@shri3k Shouldn't confuse them too much, just add a comment: https://github.com/n8henrie/.vim/blob/3e32355bf04b97188909eeec38cc604cab0cf769/nvim.vim#L34

EfforiaKnight added a commit to EfforiaKnight/ProjectDot that referenced this issue May 22, 2017
@garethellis0
Copy link

I am still seeing the same behavior (a single d in normal mode will delete the entire line), while using YouCompleteMe, even after removing my mapping for <C-c>. Disabling the plugin fixes the issue. I'm using NVIM v0.2.0 on Arch Linux. 😢

@Shougo
Copy link
Owner

Shougo commented Jun 11, 2017

I am still seeing the same behavior (a single d in normal mode will delete the entire line), while using YouCompleteMe

while using YouCompleteMe?
This is deoplete issue.
I don't understand.

@garethellis0
Copy link

Sorry, this seemed like a similar issue, so I elected to add a comment here rather then open a new issue. Would you like me to open a new issue for it? Or would you like more details?

@Shougo
Copy link
Owner

Shougo commented Jun 11, 2017

You should create new issue.
Because the problem is already fixed.
Please see the issue template.

@Shougo
Copy link
Owner

Shougo commented Jun 11, 2017

I am still seeing the same behavior (a single d in normal mode will delete the entire line), while using YouCompleteMe, even after removing my mapping for

Note: You must not exit insert mode by <C-c>.

And you must explain how to exit the insert mode.
This issue is terrible information. Because it does not explain how to exit. Just Enter normal mode.

@garethellis0
Copy link

Sorry, completely my fault. I commented on the wrong github repo.

@Shougo
Copy link
Owner

Shougo commented Jun 11, 2017

Hm. If YouCompleteMe uses timers feature, it has the same problem.
You should not use <C-c>.

sjbarag added a commit to sjbarag/dotfiles that referenced this issue Sep 21, 2017
Turns out ^c doesn't play well with some plugins (e.g.
[deoplete](Shougo/deoplete.nvim#460)), but my
muscle memory is too strong to stop doing that 🤷
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants