eraserhd / parinfer-rust

A Rust port of parinfer.
ISC License
546 stars 42 forks source link

Skip processing if buffer not modifiable #96

Closed bootleq closed 3 years ago

bootleq commented 3 years ago

Currently we have no option to prevent parinfer (vim) from modifying newly opened buffer, which brings problems, see #43.

By skipping non-modifiable buffer, user can set specific buffers non-modiflable to stop parinfer.

Usage Example

To avoid changing jar source code under .m2/repository/:

autocmd BufReadCmd zipfile:*/* setlocal nomodifiable

(Vim's built-in zip plugin will treat jar as "zipfile" buffer)

eraserhd commented 3 years ago

I'd like to resolve this by deferring any parinfer operations until the user actually modifies the buffer... but this change doesn't hurt anything, so I'll accept it.

Thanks!