def buffer(self, view):
    with file(self.backupFullPath) as old_file:
      view.erase(sublime.Region(0, view.size()))
      view.insert(0, unicode(old_file.read(), 'utf8'))

    sublime.statusMessage("%s [%s of %s]" %\
        (self.backup, self.index+1, len(self.foundBackupFiles)-1))
 def onDone(self, view, text):
     window = view.window()
     sublime.statusMessage("Creating module: " + text)
     cmd = "rake module:create[" + text + "]"
     window.runCommand("exec", ["^(...*?):([0-9]*):?([0-9]*)", cmd])
     window.runCommand("scanProject")
     sublime.statusMessage("Created module: " + text)
Esempio n. 3
0
 def __init__(self):
     jid = JID(settings["jid"])
     conn = Client(jid.getDomain(), debug=[])
     if not conn.connect():
         statusMessage("PSTO: connection error")
     if not conn.auth(jid.getNode(), settings["password"], settings["res"]):
         statusMessage("PSTO: autentification error")
     self.conn = conn
 def selectMark(self, view):
   s = view.sel()[0]
   viewName = self.viewIdentifier(view)
   sublime.statusMessage("NOT YET IMPLEMENTED")
   start = min(s.begin(), self.innerMarks[viewName])
   end = max(s.end(), self.innerMarks[viewName])
   region = sublime.Region(start, end)
   return region
	def run (self, view, args):
		sels = view.sel()
		if len(sels) == 1 and sels[0].begin() == sels[0].end():
			# count whole document
			content = view.substr(sublime.Region(0, view.size()))
			sublime.statusMessage("Word Count: %s in %s" % (self.count(content), view.fileName()))
		else:
			# count sum of words in all selections
			regions = [view.substr(sublime.Region(s.begin(), s.end())) for s in sels]
			lens = [len(reg) for reg in regions]
			counts = [self.count(region) for region in regions]
			sublime.statusMessage("Word Count: %s in region(s) of %s" % (sum(counts), view.fileName()))
def displayResults(Results, Mode, view):
	if(Mode == "Window"):
		if(Results[1] != None and Results[1] != ""):
			createWindowWithText(view, "An error or warning occurred:\n\n" + str(Results[1]))
		elif(Results[0] != None and Results[0] != ""):
			createWindowWithText(view, str(Results[0]))			
	# Message Box
	elif(Mode == "MessageBox"):
		if(Results[1] != None and Results != ""):
			sublime.messageBox("An error or warning occurred:\n\n" + str(Results[1]))
		elif(Results[0] != None and Results[0] != ""):
			sublime.statusMessage(str(Results[0]))
Esempio n. 7
0
	def switch(self, view, isCtrl):
		if isCtrl:
			# set restore point
			view.runCommand('glueMarkedUndoGroups')
			sublime.statusMessage("-- CTRL --")
			view.setStatus('Vim.status', '-- CTRL --')
		else:
			sublime.statusMessage("CTRL: OFF")
			# set restore point
			view.runCommand('markUndoGroupsForGluing')			
			view.eraseStatus('Vim.status')
			
		# set modes
		view.options().set('ctrlMode', isCtrl)
		view.options().set('commandMode', isCtrl)
    def run(self, view, args):
        # get the wikiname under the cursor.
        for s in view.sel():
            # try to find a phrase in square brackets
            name = self.phraseInSquareBrackets(view, s)
            if name == None:
                # nothing in square brackets -- try a word
                name = self.wordUnderCursor(view, s)
            if name == None:
                # total failure!
                sublime.statusMessage("No suitable hyperlink found. Try square brackets around the text.")
                return

            candidateFileName = os.path.split(view.fileName())[0] + "\\" + name + "." + self.wikiFileExtension
            print candidateFileName
            if os.access(candidateFileName, os.R_OK):
                sublime.statusMessage("Opening page: %s" % candidateFileName)
                view.window().openFile(candidateFileName)
            else:
                if sublime.questionBox("Do you want to create %s" % candidateFileName):
                    self.ensureFile(candidateFileName)
                    sublime.statusMessage("No page at %s: starting new file" % candidateFileName)
                    view.window().openFile(candidateFileName)
Esempio n. 9
0
 def onDone(self, text):
     if text:
         self.conn.send(Message(to=settings["pstobot"], body=text))
         statusMessage("PSTO: Message sended (%s)" % text)
     else:
         statusMessage("PSTO: Error. Not message")
 def run(self, window, args):
     self.window = window
     sublime.statusMessage("Downloading Packages")
     threading.Thread(target=self.getPackages).start()
Esempio n. 11
0
 def updateStatus(self, text):
     sublime.statusMessage(text);
 def setMark(self, view):
   s = view.sel()[0]
   viewName = self.viewIdentifier(view)
   point = s.begin()
   self.innerMarks[viewName] = s.begin()
   sublime.statusMessage("Set mark at char %s in %s" % (point, viewName))
 def run(self, view, args):
   for region in view.sel():
     sublime.statusMessage('reversing strings!')
     s = view.substr(region)
     s = s[::-1]
     view.replace(region, s)
 def run(self, view, args):
   sublime.setClipboard(view.syntaxName(view.sel()[0].begin()).strip());
   sublime.statusMessage('Scope copied to clipboard')