easymotion / vim-easymotion

Vim motions on speed!
http://www.vim.org/scripts/script.php?script_id=3526
7.44k stars 357 forks source link

W motion error when the computed motion jumps over _any_ Python code #509

Open kitmonisit opened 2 months ago

kitmonisit commented 2 months ago

I use junegunn/vim-plug manager. Here is my minimum .vimrc. I added a line as advised in #44

set foldmethod=indent
let g:EasyMotion_skipfoldedline = 0

call plug#begin('~/.vim/plugged')
Plug 'easymotion/vim-easymotion'
call plug#end()

Here is a simple Python file for testing convenience:

import this

def test_this():
    print()
    print()
    print()

def test_that():
    print()
    print()
    print()

To reproduce the error:

  1. :x: Fold the test_this function, put cursor above the folded function, then press <Leader><Leader>w. Error.
  2. :heavy_check_mark: Put cursor below the folded function, then press <Leader><Leader>w. It works.
  3. :x: j motion errors out when trying to jump over folds.
  4. :heavy_check_mark: b motion can jump over folds without any error.
  5. :heavy_check_mark: k motion can jump over folds without any error.

Strangely though, I have tried "jumping over folds" with my .vimrc and it works very well. I've only observed this in Python.

The error message in the vim status bar is:

EasyMotion: Vim(call):E475: Invalid argument: -1 : function EasyMotion#WB[4]..<SNR>32_EasyMotion, line 109