Fixes #1254

When breaking up a pattern into parts that can be solved
by different matchers, we sometimes produces patterns
that are disconnected. This is a problem for some
matchers. This commit changes this to make sure only
connected patterns are solved for each step.
Merge pull request #1273 from systay/1254

Fixes #1254