Skip to content

Commit bfa0eb2

Browse files
author
derek riemer
committed
update addon to work for 2022.1 release
1 parent b6c6bef commit bfa0eb2

File tree

6 files changed

+19
-23
lines changed

6 files changed

+19
-23
lines changed

addon/appModules/notepad++/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#__init__.py
22
#A part of theNotepad++ addon for NVDA
3-
#Copyright (C) 2016-2019 Tuukka Ojala, Derek Riemer
3+
#Copyright (C) 2016-2022 Tuukka Ojala, Derek Riemer
44
#This file is covered by the GNU General Public License.
55
#See the file COPYING for more details.
66

addon/appModules/notepad++/addonSettingsPanel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#addonGui.py
22
#A part of theNotepad++ addon for NVDA
3-
#Copyright (C) 2016 Tuukka Ojala, Derek Riemer
3+
#Copyright (C) 2016-2022 Tuukka Ojala, Derek Riemer
44
#This file is covered by the GNU General Public License.
55
#See the file COPYING for more details.
66

addon/appModules/notepad++/autocomplete.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
# coding: utf-8
2+
#autocomplete.py
3+
#A part of theNotepad++ addon for NVDA
4+
#Copyright (C) 2016-2022 Tuukka Ojala, Derek Riemer
5+
#This file is covered by the GNU General Public License.
6+
#See the file COPYING for more details.
7+
28
from NVDAObjects.IAccessible import IAccessible
39
import speech
410
import braille

addon/appModules/notepad++/editWindow.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#editWindow.py
22
#A part of theNotepad++ addon for NVDA
3-
#Copyright (C) 2016-2019 Tuukka Ojala, Derek Riemer
3+
#Copyright (C) 2016-2022 Tuukka Ojala, Derek Riemer
44
#This file is covered by the GNU General Public License.
55
#See the file COPYING for more details.
66

@@ -28,9 +28,10 @@
2828
class EditWindow(EditWindowBaseCls, EditableTextWithSuggestions):
2929
"""An edit window that implements all of the scripts on the edit field for Notepad++"""
3030

31-
3231
def event_loseFocus(self):
3332
#Hack: finding the edit field from the foreground window is unreliable, so cache it here.
33+
# The object tree is all sorts of fubar,
34+
# And actually can have cycles (so it's not a tree).
3435
#We can't use the weakref cache, because NVDA probably (?) kill this object off when it loses focus.
3536
#Also, derek is too lazy to verify this when it already works.
3637
self.appModule.edit = self
@@ -43,6 +44,7 @@ def event_gainFocus(self):
4344

4445
def initOverlayClass(self):
4546
#Notepad++ names the edit window "N" for some stupid reason.
47+
# Nuke it.
4648
self.name = ""
4749

4850
def script_goToMatchingBrace(self, gesture):
@@ -52,9 +54,9 @@ def script_goToMatchingBrace(self, gesture):
5254
info.expand(textInfos.UNIT_LINE)
5355
if info.text.strip() in ('{', '}'):
5456
#This line is only one brace. Not very helpful to read, lets read the previous and next line as well.
55-
#Move it's start back a line.
57+
#Move its start back a line.
5658
info.move(textInfos.UNIT_LINE, -1, endPoint = "start")
57-
# Move it's end one line, forward.
59+
# Move its end one line forward.
5860
info.move(textInfos.UNIT_LINE, 1, endPoint = "end")
5961
#speak the info.
6062
registerGeneratorObject((speech.speakMessage(i) for i in info.text.split("\n")))

addon/appModules/notepad++/incrementalFind.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#incrementalFind.py
22
#A part of theNotepad++ addon for NVDA
3-
#Copyright (C) 2016 Tuukka Ojala, Derek Riemer
3+
#Copyright (C) 2016-2022 Tuukka Ojala, Derek Riemer
44
#This file is covered by the GNU General Public License.
55
#See the file COPYING for more details.
66

@@ -15,41 +15,32 @@
1515

1616

1717
class IncrementalFind(NVDAObject):
18-
debug = False
1918
cacheBookmark = None
2019
die = False
21-
debug=False
2220

2321
def schedule(self):
24-
log.debug("may schedule a round.")
22+
log.debug("Scheduling round.")
2523
if self.die:
26-
log.debug("Not rescheduling")
2724
self.die=False
2825
return
29-
log.debug("Scheduling change watcher in 5 ms")
3026
core.callLater(5, self.changeWatcher)
3127

3228
def event_gainFocus(self):
3329
super(IncrementalFind, self).event_gainFocus()
34-
log.debug("Gain focus fired")
3530
self.schedule()
3631

3732
def event_loseFocus(self):
3833
self.die = True
39-
log.debug("Scheduling distruction.")
4034

4135
def changeWatcher(self):
42-
4336
self.schedule()
44-
log.debug("Preparing change watcher.")
4537
edit = self.appModule.edit
4638
if None is edit:
4739
#The editor gained focus. We're gonna die anyway on the next round.
4840
return
4941
textInfo = edit.makeTextInfo(textInfos.POSITION_SELECTION)
5042
if textInfo.bookmark == IncrementalFind.cacheBookmark:
5143
#Nothing has changed. Just go away.
52-
log.debug("Nothing has changed since the last round.")
5344
return
5445
IncrementalFind.cacheBookmark = textInfo.bookmark
5546
textInfo.expand(textInfos.UNIT_LINE)
@@ -64,11 +55,6 @@ def event_stateChange(self):
6455
#Squelch the "pressed" message as this gets quite annoying, I must say.
6556
pass
6657

67-
#Debug script for testing why the thing isn't firing.
68-
@script(gesture = 'kb:nvda+d')
69-
def script_debug(self, gesture):
70-
speech.speakMessage("Prepare for log spam")
71-
7258

7359
class LiveTextControl(NVDAObject):
7460
_cache = None

buildVars.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"addon_description" : _("""Notepad++ App Module.
2121
This addon improves the accessibility of Notepad ++. To learn more, press the add-on help button."""),
2222
# version
23-
"addon_version" : "2021.10.1",
23+
"addon_version" : "2022.05.1",
2424
# Author(s)
2525
"addon_author" : u"Derek Riemer <[email protected]>, Tuukka Ojala <[email protected]>",
2626
# URL for the add-on documentation support
@@ -48,3 +48,5 @@
4848
# Files that will be ignored when building the nvda-addon file
4949
# Paths are relative to the addon directory, not to the root directory of your addon sources.
5050
excludedFiles = []
51+
52+

0 commit comments

Comments
 (0)