simplenote-vim / simplenote.vim

vim plugin to interact with the simplenote service
http://www.vim.org/scripts/script.php?script_id=3582
MIT License
368 stars 31 forks source link

force autocommand processing for the BufReadPost group when the buffer is set by python #58

Closed insanum closed 10 years ago

insanum commented 10 years ago

I'm not totally sure this is the right solution to the problem, but my change works as expected.

For some reason when setting vim.current.buffer in the python code, any modelines in the note are not processed by vim. Forcing a call to doautocmd triggers modeline processing. I picked the BufReadPost group as that made the most sense.

I like to use modelines in my notes to set the FileType. Specifically txt files formatted as votl/vimorganizer files.

I couldn't see anything in the global/local settings of the note buffer that would prevent the modeline from being processed. I know for a fact modeline=1 and modelines=5 and my modeline is the last line of the txt note.

atomicules commented 10 years ago

I like this, but how about we also add it to update_note_from_current_buffer and create_new_note_from_current_buffer?

insanum commented 10 years ago

It's definitely needed for create_new_note_from_current_buffer. With update_note_from_current_buffer I didn't see an issue.