Merge 1.6.6 (#1211)
This commit is contained in:
+18
-1
@@ -229,11 +229,28 @@ final release.
|
|||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
|
## Version 1.6.6 [2022-10-25]
|
||||||
|
|
||||||
|
### Release Notes
|
||||||
|
|
||||||
|
This is a bugfix release that fixes a minor issues with following tags in the editor. It is now
|
||||||
|
possible to also follow tags that contain spaces.
|
||||||
|
|
||||||
|
### Detailed Changelog
|
||||||
|
|
||||||
|
**Bugfixes**
|
||||||
|
|
||||||
|
* Fix a bug where only the word under the cursor would be looked up when the user tried to follow a
|
||||||
|
tag in the editor. The lookup function now uses the same parser for the `@`-line as the syntax
|
||||||
|
highlighter does, so they should behave consistently. Issue #1195. PR #1209.
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
## Version 1.6.5 [2022-10-13]
|
## Version 1.6.5 [2022-10-13]
|
||||||
|
|
||||||
### Release Notes
|
### Release Notes
|
||||||
|
|
||||||
This is a bugfix release that fixes a a few minor issues. The idle time for new projects would be
|
This is a bugfix release that fixes a few minor issues. The idle time for new projects would be
|
||||||
artificially inflated as the clock was not reset when the project was first created. This only
|
artificially inflated as the clock was not reset when the project was first created. This only
|
||||||
affects the first entry in the writing statistics. A scaling issue for the Preferences dialog has
|
affects the first entry in the writing statistics. A scaling issue for the Preferences dialog has
|
||||||
also been fixed. It only affected screens with UI scaling enabled. Lastly, typing `Shift+Enter` in
|
also been fixed. It only affected screens with UI scaling enabled. Lastly, typing `Shift+Enter` in
|
||||||
|
|||||||
@@ -1874,10 +1874,10 @@ class GuiDocEditor(QTextEdit):
|
|||||||
|
|
||||||
def _followTag(self, theCursor=None, loadTag=True):
|
def _followTag(self, theCursor=None, loadTag=True):
|
||||||
"""Activated by Ctrl+Enter. Checks that we're in a block
|
"""Activated by Ctrl+Enter. Checks that we're in a block
|
||||||
starting with '@'. We then find the word under the cursor and
|
starting with '@'. We then find the tag under the cursor and
|
||||||
check that it is after the ':'. If all this is fine, we have a
|
check that it is not the tag itself. If all this is fine, we
|
||||||
tag and can tell the document viewer to try and find and load
|
have a tag and can tell the document viewer to try and find and
|
||||||
the file where the tag is defined.
|
load the file where the tag is defined.
|
||||||
"""
|
"""
|
||||||
if theCursor is None:
|
if theCursor is None:
|
||||||
theCursor = self.textCursor()
|
theCursor = self.textCursor()
|
||||||
@@ -1890,18 +1890,29 @@ class GuiDocEditor(QTextEdit):
|
|||||||
|
|
||||||
if theText.startswith("@"):
|
if theText.startswith("@"):
|
||||||
|
|
||||||
theCursor.select(QTextCursor.WordUnderCursor)
|
isGood, tBits, tPos = self.theProject.index.scanThis(theText)
|
||||||
theWord = theCursor.selectedText()
|
if not isGood:
|
||||||
cPos = theText.find(":")
|
return False
|
||||||
wPos = theCursor.selectionStart() - theBlock.position()
|
|
||||||
if wPos <= cPos:
|
theTag = ""
|
||||||
|
cPos = theCursor.selectionStart() - theBlock.position()
|
||||||
|
for sTag, sPos in zip(reversed(tBits), reversed(tPos)):
|
||||||
|
if cPos >= sPos:
|
||||||
|
# The cursor is between the start of two tags
|
||||||
|
if cPos <= sPos + len(sTag):
|
||||||
|
# The cursor is inside or at the edge of the tag
|
||||||
|
theTag = sTag
|
||||||
|
break
|
||||||
|
|
||||||
|
if not theTag or theTag.startswith("@"):
|
||||||
|
# The keyword cannot be looked up, so we ignore that
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if loadTag:
|
if loadTag:
|
||||||
logger.debug("Attempting to follow tag '%s'", theWord)
|
logger.debug("Attempting to follow tag '%s'", theTag)
|
||||||
self.loadDocumentTagRequest.emit(theWord, nwDocMode.VIEW)
|
self.loadDocumentTagRequest.emit(theTag, nwDocMode.VIEW)
|
||||||
else:
|
else:
|
||||||
logger.debug("Potential tag '%s'", theWord)
|
logger.debug("Potential tag '%s'", theTag)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
<novelWriterXML appVersion="2.0-rc1" hexVersion="0x020000c1" fileVersion="1.4" timeStamp="2022-10-20 18:17:33">
|
<novelWriterXML appVersion="2.0-rc1" hexVersion="0x020000c1" fileVersion="1.4" timeStamp="2022-10-25 18:45:45">
|
||||||
<project>
|
<project>
|
||||||
<name>Sample Project</name>
|
<name>Sample Project</name>
|
||||||
<title>Sample Project</title>
|
<title>Sample Project</title>
|
||||||
<author>Jane Smith</author>
|
<author>Jane Smith</author>
|
||||||
<author>Jay Doh</author>
|
<author>Jay Doh</author>
|
||||||
<saveCount>1385</saveCount>
|
<saveCount>1386</saveCount>
|
||||||
<autoCount>236</autoCount>
|
<autoCount>236</autoCount>
|
||||||
<editTime>69348</editTime>
|
<editTime>69352</editTime>
|
||||||
</project>
|
</project>
|
||||||
<settings>
|
<settings>
|
||||||
<doBackup>False</doBackup>
|
<doBackup>False</doBackup>
|
||||||
|
|||||||
Reference in New Issue
Block a user