Repository: nvaccess/nvda

Issue:
Problem navigating paragraphs in BarahaPad Application
### Actual behavior: 
Paragraphs are announced or recognized very slow or late.

### Expected behavior:
Should be announced or recognized very quickly.

### System configuration
#### NVDA installed/portable/running from source:
Installed

#### NVDA version:
2022.2 beta

#### Windows version: Windows 11(Windows
Version 21H2 (OS Build 22000.739)) 64 bit.

#### Name and version of other software in use when reproducing the issue:
BarahaPad Application(Baraha_10.10.400 64bit)

#### Other information about your system:
Dell Inspiron 3542 64 bit Core I3 With 4GB Ram

### 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. In previous version of NVDA This Problem has not occurred.

#### If NVDA add-ons are disabled, is your problem still occurring? Yes.

#### Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?
Yes.

Hello Team members, I am experiencing a strange problem in BarahaPad Application while navigating the paragraphs. BarahaPad is a popular Indian language editor. This is the only application for Indian Blind users for editing Indian Languages.
The problem is: While navigating the next or previous paragraph using `Ctrl+DownArrow` and `Ctrl+UpArrow`, The paragraphs will be announced very slowly. In previous version of NVDA We Had not seen such problem. Hope that your team definitely solve this bug. I am attaching the extra Log info of this BarahaPad Application.

[NVDA LOG Info.txt](https://github.com/nvaccess/nvda/files/8950111/NVDA.LOG.Info.txt)

Best regards.


Discussion:
@narayan-b-raikar  It looks like you have several invalid entries in your speech dictionary, while it is unlikely they're causing the issue you may want to look into it.
But, I never experienced such problem in previous virsions of NVDA like v 2021.3.5 or v 2021.2 or older. I am seing this from NVDA V 2022.2 beta1. I thought that, this bug may be solve in next beta update. But, after downloading and Testing of NVDA V 2022.2 beta2, I am experiencing Same problem. I also tested Alpha snapshots. But, Still I am facing the same problem.


Resolving patch:
diff --git a/source/NVDAObjects/window/edit.py b/source/NVDAObjects/window/edit.py
--- a/source/NVDAObjects/window/edit.py
+++ b/source/NVDAObjects/window/edit.py
@@ -684,17 +684,24 @@ def getTextWithFields(self, formatConfig: Optional[Dict] = None) -> textInfos.Te
 			formatConfig=config.conf["documentFormatting"]
 		textRange=self._rangeObj.duplicate
 		textRange.collapse(True)
+		if not formatConfig["detectFormatAfterCursor"]:
+			textRange.expand(comInterfaces.tom.tomCharacter)
+			return [
+				textInfos.FieldCommand(
+					"formatChange",
+					self._getFormatFieldAtRange(textRange, formatConfig)
+				),
+				self._getTextAtRange(self._rangeObj)
+			]
 		commandList=[]
 		endLimit=self._rangeObj.end
 		while textRange.end<endLimit:
 			self._expandFormatRange(textRange, formatConfig)
-			# Only add formatting and text if it is not marked as hidden.
-			# e.g. hyperLinks have hidden text at their beginning.
-			if not textRange.font.hidden:
-				commandList.append(
-					textInfos.FieldCommand("formatChange", self._getFormatFieldAtRange(textRange, formatConfig))
-				)
-				commandList.append(self._getTextAtRange(textRange))
+			commandList.append(textInfos.FieldCommand(
+				"formatChange",
+				self._getFormatFieldAtRange(textRange, formatConfig)
+			))
+			commandList.append(self._getTextAtRange(textRange))
 			end = textRange.end
 			textRange.start = end
 			#Trying to set the start past the end of the document forces both start and end back to the previous offset, so catch this
@@ -772,13 +779,6 @@ def move(self,unit,direction,endPoint=None):
 		else:
 			moveFunc=self._rangeObj.Move
 		res=moveFunc(unit,direction)
-		if not endPoint:
-			# For a normal move, I.e. not moving just one end,
-			# skip over any hidden text.
-			# E.g. hyperlinks have some hidden text at their beginning.
-			# So that the review cursor does not navigate through this text.
-			while res and self._rangeObj.font.hidden:
-				res = moveFunc(unit, 1 if direction > 0 else -1)
 		return res
 
 	def _get_bookmark(self):


Test patch: