Repository: nvaccess/nvda

Issue:
Say all is interrupted when using find next/previous commands
### Steps to reproduce:

* In keyboard options, enable "Allow skim reading" option
* Go to any webpage, e.g.: https://www.nvaccess.org/
* Press NVDA+control+F to search a term, e.g. "NVDA".
*Press NVDA+DownArrow to start SayAll
* Press NVDA+F3

### Actual behavior:

NVDA:
* sets the virtual cursor on the next occurrence of the searched word
* reads a little bit of text (from the searched word to the end of the line)
* stops reading

### Expected behavior:

NVDA:
* sets the virtual cursor on the next occurrence of the searched word
* continues reading in say all from the new position of the virtual cursor onward, i.e. from the next occurrence of the searched word onward.

### System configuration
#### NVDA installed/portable/running from source:

Installed

#### NVDA version:

2020.2

#### Windows version:

Win 10

#### Name and version of other software in use when reproducing the issue:

#### Other information about your system:

### Other questions
#### Does the issue still occur after restarting your computer?
Yes
#### Have you tried any other versions of NVDA? If so, please report their behaviors.
Not now but I remember it has always behaved this way.
#### If addons are disabled, is your problem still occuring?
Yes
#### Did you try to run the COM registry fixing tool in NVDA menu / tools?
No


Discussion:

Resolving patch:
diff --git a/source/cursorManager.py b/source/cursorManager.py
--- a/source/cursorManager.py
+++ b/source/cursorManager.py
@@ -17,7 +17,7 @@
 from gui import guiHelper
 import sayAllHandler
 import review
-from scriptHandler import willSayAllResume
+from scriptHandler import willSayAllResume, script
 import textInfos
 import api
 import speech
@@ -148,7 +148,7 @@ def _caretMovementScriptHelper(self,gesture,unit,direction=None,posConstant=text
 			speech.speakSelectionChange(oldInfo, selection)
 		self.selection = selection
 
-	def doFindText(self,text,reverse=False,caseSensitive=False):
+	def doFindText(self, text, reverse=False, caseSensitive=False, willSayAllResume=False):
 		if not text:
 			return
 		info=self.makeTextInfo(textInfos.POSITION_CARET)
@@ -157,7 +157,8 @@ def doFindText(self,text,reverse=False,caseSensitive=False):
 			self.selection=info
 			speech.cancelSpeech()
 			info.move(textInfos.UNIT_LINE,1,endPoint="end")
-			speech.speakTextInfo(info,reason=controlTypes.REASON_CARET)
+			if not willSayAllResume:
+				speech.speakTextInfo(info, reason=controlTypes.REASON_CARET)
 		else:
 			wx.CallAfter(gui.messageBox,_('text "%s" not found')%text,_("Find Error"),wx.OK|wx.ICON_ERROR)
 		CursorManager._lastFindText=text
@@ -174,21 +175,42 @@ def run():
 	# Translators: Input help message for NVDA's find command.
 	script_find.__doc__ = _("find a text string from the current cursor position")
 
+	@script(
+		description=_(
+			# Translators: Input help message for find next command.
+			"find the next occurrence of the previously entered text string from the current cursor's position"
+		),
+		gesture="kb:NVDA+f3",
+		resumeSayAllMode=sayAllHandler.CURSOR_CARET,
+	)
 	def script_findNext(self,gesture):
 		if not self._lastFindText:
 			self.script_find(gesture)
 			return
-		self.doFindText(self._lastFindText, caseSensitive = self._lastCaseSensitivity)
-	# Translators: Input help message for find next command.
-	script_findNext.__doc__ = _("find the next occurrence of the previously entered text string from the current cursor's position")
-
+		self.doFindText(
+			self._lastFindText,
+			caseSensitive=self._lastCaseSensitivity,
+			willSayAllResume=willSayAllResume(gesture),
+		)
+
+	@script(
+		description=_(
+			# Translators: Input help message for find previous command.
+			"find the previous occurrence of the previously entered text string from the current cursor's position"
+		),
+		gesture="kb:NVDA+shift+f3",
+		resumeSayAllMode=sayAllHandler.CURSOR_CARET,
+	)
 	def script_findPrevious(self,gesture):
 		if not self._lastFindText:
 			self.script_find(gesture)
 			return
-		self.doFindText(self._lastFindText,reverse=True, caseSensitive = self._lastCaseSensitivity)
-	# Translators: Input help message for find previous command.
-	script_findPrevious.__doc__ = _("find the previous occurrence of the previously entered text string from the current cursor's position")
+		self.doFindText(
+			self._lastFindText,
+			reverse=True,
+			caseSensitive=self._lastCaseSensitivity,
+			willSayAllResume=willSayAllResume(gesture),
+		)
 
 	def script_moveByPage_back(self,gesture):
 		self._caretMovementScriptHelper(gesture,textInfos.UNIT_LINE,-config.conf["virtualBuffers"]["linesPerPage"],extraDetail=False)
@@ -411,8 +433,6 @@ def reportSelectionChange(self, oldTextInfo):
 		"kb:control+a": "selectAll",
 		"kb:control+c": "copyToClipboard",
 		"kb:NVDA+Control+f": "find",
-		"kb:NVDA+f3": "findNext",
-		"kb:NVDA+shift+f3": "findPrevious",
 		"kb:alt+upArrow":"moveBySentence_back",
 		"kb:alt+downArrow":"moveBySentence_forward",
 	}


Test patch: