def extend_selection(self, path_obj):
        """Trigger selection extension if needed.

        Parameters
        ==========
        path_obj (fileman.pathobj.PathObject instance)
            path object targeted by the mouse.
        """
        ### reference path
        path = path_obj.path

        ### if it isn't selectable, exit method by returning
        if path not in self.selectable_paths:
            return

        ### if there's no selected path, select the given
        ### one only

        if not any(self.selection_states):
            self.select_single_path(path_obj)

        ### otherwise, select the given one and extend the
        ### selection among all the selected paths

        else:

            ## make it so the path of the given path obj
            ## is marked as selected

            index = self.selectable_paths.index(path)
            self.selection_states[index] = True

            ## also mark the path index as the last
            ## selected one
            self.last_selected_index = index

            ## finally perform the extension of the
            ## selection if needed
            self.select_in_range()

            ### update appearance of all paths
            self.update_path_objs_appearance()

            ### since the selection may have changed, make
            ### it so the file manager updates its path
            ### selection
            self.fm.update_entry_with_selected()
Trigger selection extension if needed.

        Parameters
        ==========
        path_obj (fileman.pathobj.PathObject instance)
            path object targeted by the mouse.
        
nodezator/fileman/dirpanel/mouseop.py