tpope / vim-obsession

obsession.vim: continuously updated session files
http://www.vim.org/scripts/script.php?script_id=4472
1.76k stars 70 forks source link

Weird error messages never happened before #59

Closed markwu closed 4 years ago

markwu commented 4 years ago

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

markwu commented 4 years ago

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

let g:obsession_no_bufenter = 1

to avoid this error.

markwu commented 4 years ago

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
mvanderkamp commented 4 years ago

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

markwu commented 4 years ago

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

tpope commented 4 years ago

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

markwu commented 4 years ago

Thanks, I confirmed it fixed.