mltony / nvda-indent-nav Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v2.0
License: GNU General Public License v2.0
We have received complete translations for the following languages:
An additional 13 languages have been partially translated.
Most languages have not been translated in the latest version 2.2. I would like to request the release of a minor version of 2.2.1 to include the translation results in the current 6 languages to facilitate the promotion of this add-on in more countries/regions.
For translations a 'stable' branch is required, see https://github.com/nvaccess/mrconfig#translating-your-addon
This branch must also be available from https://github.com/nvdaaddons/IndentNav
Hello! Are you planing to add compability with NVDA 2023.1?
It is a very nice add-on for software engineers productivity and I do not want to lost this functionality
Some programmers put blank lines between their functions, but with whitespace on the lines. I have no idea why, but nonetheless it's extremely annoying to go through with indent nav. It would be awesome if you could make it so blank lines containing only indentation are ignored the same way standard blank lines are.
STR:
This seems to have broken with the notepad rewrite.
Currently, Java access bridge has a bug that crashes NVDA with this addon. If the text exceeds more than 10238 characters, writes from C++ code on the Java Access Bridge side may produce an access viollation and crash the NVDA process. I thought of an idea to overcome this limitation, currently the fast line manager gets all the lines from the text at once, however if a single text line don't exceed this number of characters, we could try to use the traditional line manager in this case to make the addon compatible with Java programs. However, since I don't know much about this addon's internals, I'm opening this for discussion. The best case would be to fix this on the Java Access Bridge side, however it would require both a Java and NVDA update. I was trying to use the addon to see the exception cause of a stack trace on IntelliJ Idea, for this case this fix could work.
The add-on's gesture descriptions are currently not localizable and translators are unable to translate these strings.
I will fix this later
In some programs, like Notepad2 or any other application where there is no product name for the active app module, the addon is erroring out when trying to determine whether VSCode is focused. Traceback is as follows:
error executing script: <bound method EditableIndentNav.script_moveToPreviousSibling of <NVDAObjects.Dynamic_ScintillaIAccessibleScintillaWindowNVDAObjectEditableIndentNav object at 0x2422A2F0>> with gesture 'alt+NVDA+up arrow'
Traceback (most recent call last):
File "scriptHandler.pyc", line 295, in executeScript
File "C:\users\username\AppData\Roaming\nvda\addons\IndentNav\globalPlugins\indent_nav\__init__.py", line 1672, in script_moveToPreviousSibling
self.move(-1, [msgEditable])
File "C:\users\username\AppData\Roaming\nvda\addons\IndentNav\globalPlugins\indent_nav\__init__.py", line 1717, in move
self.moveInEditable(increment, errorMessages[0], unbounded, op, speakOnly=speakOnly, moveCount=moveCount, excludeFilterRegex=excludeFilterRegex)
File "C:\users\username\AppData\Roaming\nvda\addons\IndentNav\globalPlugins\indent_nav\__init__.py", line 1721, in moveInEditable
with self.getLineManager() as lm:
File "C:\users\username\AppData\Roaming\nvda\addons\IndentNav\globalPlugins\indent_nav\__init__.py", line 993, in __enter__
document = self.obj.makeEnhancedTextInfo(textInfos.POSITION_ALL, allowPlainTextInfoInVSCode=legacyVSCode)
File "C:\users\username\AppData\Roaming\nvda\addons\IndentNav\globalPlugins\indent_nav\__init__.py", line 1999, in makeEnhancedTextInfo
if not self.isVscodeApp():
File "C:\users\username\AppData\Roaming\nvda\addons\IndentNav\globalPlugins\indent_nav\__init__.py", line 1975, in isVscodeApp
return self.appModule.productName.startswith("Visual Studio Code")
AttributeError: 'NoneType' object has no attribute 'startswith'
This should be an easy fix, just check to see whether the productName is of type None. If so, convert it to a string.
Some editors, for example notepad2 have text fields that don't seem to work with the latest version of the add-on.
No idea what changed, but interestingly enough I'm able to use version 1.3 just fine.
Developer info for navigator object:
name: u''
role: ROLE_EDITABLETEXT
states: STATE_MULTILINE, STATE_FOCUSABLE, STATE_FOCUSED
isFocusable: True
hasFocus: True
Python object: <NVDAObjects.Dynamic_ScintillaIAccessibleScintillaWindowNVDAObject object at 0x0568E8B0>
Python class mro: (<class 'NVDAObjects.Dynamic_ScintillaIAccessibleScintillaWindowNVDAObject'>, <class 'NVDAObjects.IAccessible.scintilla.Scintilla'>, <class 'NVDAObjects.IAccessible.IAccessible'>, <class 'NVDAObjects.window.scintilla.Scintilla'>, <class 'NVDAObjects.behaviors.EditableTextWithAutoSelectDetection'>, <class 'NVDAObjects.behaviors.EditableText'>, <class 'editableText.EditableText'>, <class 'NVDAObjects.window.Window'>, <class 'NVDAObjects.NVDAObject'>, <class 'documentBase.TextContainerObject'>, <class 'baseObject.ScriptableObject'>, <class 'baseObject.AutoPropertyObject'>, <type 'object'>)
description: None
location: RectLTWH(left=1169, top=118, width=1687, height=1535)
value: None
appModule: <'appModuleHandler' (appName u'notepad2', process ID 2120) at address 568ef90>
appModule.productName: None
appModule.productVersion: None
TextInfo: <class 'NVDAObjects.window.scintilla.ScintillaTextInfo'>
windowHandle: 591398
windowClassName: u'Scintilla'
windowControlID: 64259
windowStyle: 1410334720
windowThreadID: 9264
windowText: u'\u6854\u7369\u6920\u2073\u2061\u6574\u7473\u0a0d\u4909\u2074\u6168\u2073\u6e69\u6564\u746e\u6465\u7420\u7865\u0d74\u090a\u6109\u646e\u7420\u7865\u2074\u6e69\u6564\u746e\u6465\u6120\u2074\u6e61\u746f\u6568\u2072\u656c\u6576\u0d6c\n'
displayText: u'1This is a test2 It has indented text3 and text indented at another level4'
IAccessibleObject: <POINTER(IAccessible) ptr=0xa6fd388 at 56c85d0>
IAccessibleChildID: 0
IAccessible event parameters: windowHandle=591398, objectID=-4, childID=0
IAccessible accName: u'\u6854\u7369\u6920\u2073\u2061\u6574\u7473\u0a0d\u4909\u2074\u6168\u2073\u6e69\u6564\u746e\u6465\u7420\u7865\u0d74\u090a\u6109\u646e\u7420\u7865\u2074\u6e69\u6564\u746e\u6465\u6120\u2074\u6e61\u746f\u6568\u2072\u656c\u6576\u0d6c\n'
IAccessible accRole: ROLE_SYSTEM_CLIENT
IAccessible accState: STATE_SYSTEM_FOCUSED, STATE_SYSTEM_FOCUSABLE, STATE_SYSTEM_VALID (1048580)
IAccessible accDescription: None
IAccessible accValue: None
Currently, on NVDA snapshots (later 2023.1), the following is written to the log every time I try to use an indent nav command:
ERROR - scriptHandler.executeScript (08:54:47.188) - MainThread (38888):
error executing script: <bound method EditableIndentNav.script_moveToParent of <NVDAObjects.Dynamic_EditWindowScintillaIAccessibleScintillaWindowNVDAObjectEditableIndentNav object at 0x0912AED0>> with gesture 'alt+NVDA+left arrow'
Traceback (most recent call last):
File "scriptHandler.pyc", line 289, in executeScript
File "C:\Users\Owner\AppData\Roaming\nvda\addons\IndentNav\globalPlugins\indent_nav.py", line 548, in script_moveToParent
self.move(-1, [msgEditable], unbounded=True, op=operator.lt)
File "C:\Users\Owner\AppData\Roaming\nvda\addons\IndentNav\globalPlugins\indent_nav.py", line 485, in move
self.moveInEditable(increment, errorMessages[0], unbounded, op, speakOnly=speakOnly, moveCount=moveCount)
File "C:\Users\Owner\AppData\Roaming\nvda\addons\IndentNav\globalPlugins\indent_nav.py", line 527, in moveInEditable
self.crackle(indentLevels)
File "C:\Users\Owner\AppData\Roaming\nvda\addons\IndentNav\globalPlugins\indent_nav.py", line 418, in crackle
if self.isReportIndentWithTones():
File "C:\Users\Owner\AppData\Roaming\nvda\addons\IndentNav\globalPlugins\indent_nav.py", line 415, in isReportIndentWithTones
return config.conf["documentFormatting"]["reportLineIndentationWithTones"]
File "config_init_.pyc", line 1058, in getitem
KeyError: 'reportLineIndentationWithTones'
This is most likely due to the following entry in the changelog:
• The configuration specification has been altered, keys have been removed or modified (#14233).
◦ In [documentFormatting] section:
▪ reportLineIndentation stores an int value (0 to 3) instead of a boolean
▪ reportLineIndentationWithTones has been removed.
I'm not sure what value tones has in that range of integers, but perhaps its documented somewhere? In any case I imagine this is probably a pretty simple fix. Going to give it a look when I have time, but if you have any other ideas or are able to fix it faster, that would be great too! :)
Hi @mltony
I may have discovered an oversight while inspecting the code.
The description of "moveToNextSiblingForce" is:
Moves to the next line with the same indentation level as the current line potentially in the following indentation block.
The gesture description of "moveToPreviousSiblingForce" should be similar to the "moveToNextSiblingForce" expression, for example:
Moves to the previous line with the same indentation level as the current line potentially in the preceding indentation block.
In fact, the gesture description of "moveToPreviousSiblingForce" is:
Moves to the previous line with the same indentation level as the current line within the current indentation block.
i will fix it
Hi @mltony
For example in NVDA's input gesture dialog, Moves to the next child/parent in tree view, does not work as expected.
NVDA reports "NO child/no parent"
Are you still maintaining the navigation in treeview? It also doesn't follow the key layout settings in indent-nav.
Hi, this add-on is very useful for me as a software developer, but I think it could be better with some changes:
Lets see indentation blocks as elements, and lines as part of those elements. The add-on doesn't need to interact with lines because If someone needs to move to the next or previous line can use the standard system or NVDA commands.
So, next sibling showld move to the next block at the same indentation level and not to the next line.
Same for previous sibling.
Add the option to move to next block with a lesser indentation level. Can be useful to skipt an entire block ignoring children from that block.
I already made these changes for my personal use, I can send to you a pull request if you want.
Hi @mltony
Currently this add-on is still using the old add-on template.
This caused an issue where the tables in the document were not being rendered correctly.
Of course we can have other ways of rendering the table, but I think using an add-on template is a more suitable option.
Using add-on templates you can also use github actions to publish add-on.
If you don't have time to do this right now, I'd be happy to help.
Btw, @nvdaes has helped register the add-on with the translation system. If you wish, you can grant me access to this repository and I will be willing to provide localization management.
Thanks
Cary
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.