mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Edit book: Fix auto-complete of closing tag not working when typing the closing tag at just before a word (the word would become the closing tag name).
This commit is contained in:
parent
4d7b2a379a
commit
d31bf5a1ac
@ -613,7 +613,7 @@ class Smarts(NullSmarts):
|
|||||||
def auto_close_tag(self, editor):
|
def auto_close_tag(self, editor):
|
||||||
c = editor.textCursor()
|
c = editor.textCursor()
|
||||||
block, offset = c.block(), c.positionInBlock()
|
block, offset = c.block(), c.positionInBlock()
|
||||||
tag = find_closest_containing_tag(block, offset, max_tags=4000)
|
tag = find_closest_containing_tag(block, offset - 1, max_tags=4000)
|
||||||
if tag is None:
|
if tag is None:
|
||||||
return False
|
return False
|
||||||
c.insertText('/%s>' % tag.name)
|
c.insertText('/%s>' % tag.name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user