tpope/vim-obsession

Weird error messages never happened before

markwu opened this issue · 6 comments

Weird error messages never happened before.

Messages maintainer: Bram Moolenaar <Bram@vim.org>
Error detected while processing BufEnter Autocommands for "*":
Vim(mksession):E11: Invalid in command-line window; <CR> executes, CTRL-C quits: mksession! /Users/mark/.vim/sessions/\%Users\%mark\%.dot_vim.vim
Press ENTER or type command to continue

reproduce steps

  1. vim -u NONE
  2. q: to open command line window
  3. type :mksession to make a session

my platform

macOS 10.14.6
head version of vim, neovim, macvim

It seems I have to disable s:persist() when enter buffer with

let g:obsession_no_bufenter = 1

to avoid this error.

Seems no way to identify command line window, I just use silent avoid those error messages.

  autocmd BufEnter *
        \ if !get(g:, 'obsession_no_bufenter') |
        \     silent! exe s:persist() |
        \ endif

Deleted my comments since I'm a dolt- silent! should work fine.

I tested it, but still get the same error messages.

tpope commented

I thought I tested it too but I guess not. Looks like 'buftype' hasn't been set yet. God, why is this so stupid.

Thanks, I confirmed it fixed.