def run(self, view, args):

        clipboard = sublime.getClipboard()

        sel = view.sel()
        initial_selection = [s for s in sel]
        sel.clear()

        adjusted_selection = []
        accumulated_shift = 0

        for s in initial_selection:
            s = self.adjustPosition(s, accumulated_shift)
            adjusted_selection.append(s)
            sel.add(s)
            view.runCommand("expandSelectionTo line")
            accumulated_shift += sel[0].end() - sel[0].begin()
            view.runCommand("copy")
            begin = sel[0].begin()
            end = sel[0].end()
            view.runCommand("toggleComment")
            accumulated_shift += sel[0].end() - end
            self.gotoPosition(sel, begin)
            view.runCommand("paste")
            sel.clear()

        [sel.add(s) for s in adjusted_selection]

        sublime.setClipboard(clipboard)
    def run(self, view, args):
        clipboard = sublime.getClipboard()
        sel = view.sel()
        initial_selection = [s for s in sel]
        sel.clear()

        adjusted_selection = []
        accumulated_selection_size = 0

        for s in initial_selection:
            s = self.adjustPosition(s, accumulated_selection_size)
            adjusted_selection.append(s)
            sel.add(s)
            view.runCommand("expandSelectionTo line")
            accumulated_selection_size += self.selectionSize(sel[0])
            view.runCommand("copy")
            view.runCommand("move characters 1")
            view.runCommand("paste")
            sel.clear()

        [sel.add(s) for s in adjusted_selection]

        sublime.setClipboard(clipboard)
 def append(self, content):
   # appends killed data to the current entry. 
   # Also updates the windows clipboard with 
   # everything in this kill entry
   self.killRing[-1] = self.killRing[-1] + content
   sublime.setClipboard(self.killRing[-1])
 def run(self, view, args):
   sublime.setClipboard(view.syntaxName(view.sel()[0].begin()).strip());
   sublime.statusMessage('Scope copied to clipboard')