'Replaces the current word with the provided string in each selection
For the definition of word, see get_current_word()
:param view:
the current view
:param edit:
the current edit
:param value:
the string to replace the current word with'

def replace_word(self, view, edit, value):

    new_regions = []
    for sel in view.sel():
        if sel.empty():
            word_region = self.get_current_word(view, sel.end())
            start_point = word_region.begin()
            end_point = word_region.end()
        else:
            word_region = self.get_current_word(view, sel)
            start_point = word_region.begin()
            end_point = word_region.end()
        view.replace(edit, getRegion(start_point, end_point), value)
        if sel.empty():
            start_point = end_point = (start_point + len(value))
        else:
            end_point = (start_point + len(value))
        new_regions.append(getRegion(start_point, end_point))
    self.update_selections(view, new_regions)
