Search code examples
javascriptvimperator

"TypeError: elem is null" on autocmd'ed events.feedkey function


The following line is causing the error:

autocmd LocationChange .* js events.feedkeys("<Esc>",true)

when I switch pages. Typing js events.feedkeys("",true) directly into the command line does not output any error messages. What am I doing wrong and how can I fix it?


Solution

  • This does not directly answer the question, but the behavior I was looking for was enabled by

     set focuscontent