pusher / atom-pair

An Atom package that allows for epic pair programming
MIT License
1.45k stars 28 forks source link

Snippet issue on other connected clients #15

Closed engbmsdev closed 9 years ago

engbmsdev commented 9 years ago

When I use a code snippet (e.g. script + TAB on HTML page), my friend receives the evaluated snippet + snippet identifier.

My workstation

screen shot 2015-02-24 at 14 27 01 screen shot 2015-02-24 at 14 27 08

My friend

myfriend

Thank you!

jpatel531 commented 9 years ago

Ah thanks for bringing this to our attention! I'll get on it right away :)

snollygolly commented 9 years ago

I looked into this last night and was curious how you intend to fix it. It looks like that's a snippet:expand event, could we bind to that and somehow tell the client that the text we're replacing is part of a snippet replace?

jpatel531 commented 9 years ago

Hi there! I realized I was completely short-sighted in how I defined a 'buffer substitution' -- it used to be when the old range contained the new range, not realizing it can actually be the other way round. E.g when expanding snippets, the new range is a superset of the old range.

A bit mad how simple the solution was. I'll roll this out in version 2.0.0, which has a bunch of new features, e.g. multiple tab sharing