eraserhd / parinfer-rust

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

Typing past the line limit leads to wrapping in the middle of a word #136

Open kovasap opened 1 year ago

kovasap commented 1 year ago

| denotes the edge of my vim terminal window. This problem only happens when going past the edge of my screen (upon which my test visually wraps with set wrap). This problem goes away when I use set nolinebreak.

When I put my cursor at the end of this function argument list:

(defn tile-from-str
  [row-idx col-idx [tile-letter bonus-resource-letter bonus-resource-quantity]] |
  code)

and type "testing", I get:

(defn tile-from-str
  [row-idx col-idx [tile-letter bonus-resource-letter bonus-resource-quantitying| test]]
  code)

parinfer seems to break my word right in the middle as I'm typing it.

This problem is only present when parinfer is on and doesn't seem to be effected when I set formatoptions=.

kovasap commented 1 year ago

This also happens with https://github.com/gpanders/nvim-parinfer, so maybe it's a problem with the parinfer algorithm itself, or how it gets info from vim about where the cursor is.