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

Mapping p is causing delay, is there any way to fix this? #19

Open
benwoodward opened this issue Feb 17, 2020 · 3 comments
Open

Mapping p is causing delay, is there any way to fix this? #19

benwoodward opened this issue Feb 17, 2020 · 3 comments

Comments

@benwoodward
Copy link

benwoodward commented Feb 17, 2020

nmap p <plug>(YoinkPaste_p)

  • I've checked and I don't have any other mappings beginning with 'p'.
  • Normally p will paste instantaneously
  • Adding the above mapping causes a delay to occur
  • If I map YoinkPaste_p to pp or anything else, there is no delay.

Does anyone else experience this issue, and is there a way to fix it?

❯ nvim -v
NVIM v0.4.2
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/tmp/neovim-20190916-88369-176iaxs/neovim-0.4.2/build/config -I/tmp/neovim-20190916-88369-176iaxs/neovim-0.4.2/src -I/usr/local/include -I/tmp/neovim-20190916-88369-176iaxs/neovim-0.4.2/deps-build/include -I/usr/local/opt/gettext/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/tmp/neovim-20190916-88369-176iaxs/neovim-0.4.2/build/src/nvim/auto -I/tmp/neovim-20190916-88369-176iaxs/neovim-0.4.2/build/include
Compiled by brew@Mojave-2.local

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/Cellar/neovim/0.4.2/share/nvim"

Run :checkhealth for more info
 337   │ FUNCTION  yoink#paste()
 338   │     Defined: ~/.dotfiles/.config/nvim/plugged/vim-yoink/autoload/yoink.vim line 134
 339   │ Called 1 time
 340   │ Total time:   0.000537
 341   │  Self time:   0.000440
 342   │
 343   │ count  total (s)   self (s)
 344   │     1              0.000013     let previousPosition = getpos('.')
 345   │     1              0.000307     exec "normal! \"" . s:currentPasteRegister . s:cnt . s:currentPasteType
 346   │
 347   │     1   0.000140   0.000052     call yoink#adjustLastChangeIfNecessary()
 348   │
 349   │     1              0.000004     if g:yoinkMoveCursorToEndOfPaste
 350   │                                     let newPosition = getpos('.')
 351   │                                     if abs(newPosition[1] - previousPosition[1]) > 1
 352   │                                         " Only add to the jump list if the paste moved the cursor more than 1 line
 353   │                                         call setpos('.', previousPosition)
 354   │                                         normal! m`
 355   │                                         call setpos('.', newPosition)
 356   │                                     endif
 357   │     1              0.000001     endif
 358   │
 359   │     1   0.000034   0.000025     call yoink#startUndoRepeatSwap()
@svermeulen
Copy link
Owner

How much of a delay? From your profiling it looks like 0.000537 seconds? I assume it's actually more than that though

@benwoodward
Copy link
Author

I was hoping I'd be able to find the delay in the profile log, it's more like 1s. If you're not experiencing this, then it's likely some unrelated issue buried in my vim configs.

@svermeulen
Copy link
Owner

Does this occur when using a .vimrc with nothing else except vim yoink?

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

2 participants