capitaomorte/yasnippet — pull request #410 by npostavs (2013-10-14 05:38:00+00:00)
Title: inhibit change hooks during (insert content)

I reproduced the problem with
```elisp
(progn
(switch-to-buffer "test.cc")
(c++-mode)
(insert "#include \n")
(save-restriction
(narrow-to-region (point) (point))
(insert "main")))
```

This corresponds to the `(insert content)` in `yas-expand-snippet`.

It's something about the 0 size region that cc-mode doesn't like. I don't understand 100% why this is (`cc-mode` is too complicated for mortals to understand) but inhibiting cc-mode's change hooks solves the issue for me.