PluginSelectionEncloser.py

branch
eric7
changeset 53
ceb9ed8084db
parent 52
d2119f1dd5b3
child 55
ccddc623f3c1
equal deleted inserted replaced
52:d2119f1dd5b3 53:ceb9ed8084db
22 # Start-Of-Header 22 # Start-Of-Header
23 name = "Selection Encloser Plug-in" 23 name = "Selection Encloser Plug-in"
24 author = "Detlev Offenbach <detlev@die-offenbachs.de>" 24 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
25 autoactivate = True 25 autoactivate = True
26 deactivateable = True 26 deactivateable = True
27 version = "1.0.0" 27 version = "10.0.0"
28 className = "SelectionEncloserPlugin" 28 className = "SelectionEncloserPlugin"
29 packageName = "SelectionEncloser" 29 packageName = "SelectionEncloser"
30 shortDescription = "Enclose the selection with a string." 30 shortDescription = "Enclose the selection with a string."
31 longDescription = ( 31 longDescription = (
32 """This plug-in implements a tool to enclose the selection of""" 32 """This plug-in implements a tool to enclose the selection of"""
373 return 373 return
374 374
375 if '%s' in encloseString: 375 if '%s' in encloseString:
376 newText = encloseString % editor.selectedText() 376 newText = encloseString % editor.selectedText()
377 elif '{0}' in encloseString or '{}' in encloseString: 377 elif '{0}' in encloseString or '{}' in encloseString:
378 # __IGNORE_WARNING_M613__
378 newText = encloseString.format(editor.selectedText()) 379 newText = encloseString.format(editor.selectedText())
379 else: 380 else:
380 newText = encloseString + editor.selectedText() + encloseString 381 newText = encloseString + editor.selectedText() + encloseString
381 editor.beginUndoAction() 382 editor.beginUndoAction()
382 editor.replaceSelectedText(newText) 383 editor.replaceSelectedText(newText)

eric ide

mercurial