src/eric7/QScintilla/MarkupProviders/MarkdownProvider.py

branch
eric7
changeset 10692
9becf9ca115c
parent 10482
72d9b5ea39b4
child 11006
a671918232f3
equal deleted inserted replaced
10691:d1a603a70f83 10692:9becf9ca115c
273 if editor is None: 273 if editor is None:
274 return 274 return
275 275
276 editor.beginUndoAction() 276 editor.beginUndoAction()
277 markup = "> " 277 markup = "> "
278 sline, sindex, eline, eindex = editor.getSelection() 278 sline, _sindex, eline, eindex = editor.getSelection()
279 for line in range(sline, eline + 1 if eindex > 0 else eline): 279 for line in range(sline, eline + 1 if eindex > 0 else eline):
280 editor.insertAt(markup, line, 0) 280 editor.insertAt(markup, line, 0)
281 editor.endUndoAction() 281 editor.endUndoAction()
282 282
283 def hasImage(self): 283 def hasImage(self):
301 if editor is None: 301 if editor is None:
302 return 302 return
303 303
304 dlg = ImageMarkupDialog(ImageMarkupMode.MarkDown) 304 dlg = ImageMarkupDialog(ImageMarkupMode.MarkDown)
305 if dlg.exec() == QDialog.DialogCode.Accepted: 305 if dlg.exec() == QDialog.DialogCode.Accepted:
306 address, altText, title, originalSize, width, height = dlg.getData() 306 address, altText, title, _originalSize, _width, _height = dlg.getData()
307 307
308 if title: 308 if title:
309 markup = '![{0}]({1} "{2}")'.format(altText, address, title) 309 markup = '![{0}]({1} "{2}")'.format(altText, address, title)
310 else: 310 else:
311 markup = "![{0}]({1})".format(altText, address) 311 markup = "![{0}]({1})".format(altText, address)
366 366
367 markup = " 1. " if numberedList else " * " 367 markup = " 1. " if numberedList else " * "
368 lineSeparator = editor.getLineSeparator() 368 lineSeparator = editor.getLineSeparator()
369 editor.beginUndoAction() 369 editor.beginUndoAction()
370 if editor.hasSelectedText(): 370 if editor.hasSelectedText():
371 startLine, startIndex, endLine, endIndex = editor.getSelection() 371 startLine, _startIndex, endLine, endIndex = editor.getSelection()
372 if endIndex == 0: 372 if endIndex == 0:
373 endLine -= 1 373 endLine -= 1
374 for line in range(startLine, endLine + 1): 374 for line in range(startLine, endLine + 1):
375 editor.insertAt(markup, line, 0) 375 editor.insertAt(markup, line, 0)
376 editor.setCursorPosition(endLine + 1, 0) 376 editor.setCursorPosition(endLine + 1, 0)

eric ide

mercurial