Under what conditions will healers switch targets?

Based on my experience, healers primarily follow other units that are within their range. If you have two units outside the range of a healer with no target in range, the healer will go to the closer one and follow it, regardless of the health values of the units. While this makes healers "dumb" they are not totally useless, because if there are multiple units within range, I believe the healer will switch targets once the unit it is targeting has full health. If the target has higher health but is not fully healed, the healer will follow it even if there is another unit closer to death and within range. If there is a target within range and it has full health, the healer will still follow it instead of leave to heal an injured unit out of the healer's range.

Granted, I haven't used healers in months because their housing cost is so high, so my experience could easily be out of date.