Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Run the tests before committing, and add a test when you fix a bug.

## Project-specific notes

- `analyzer.py`, `snippets.py`, `editing.py`, `problems.py`, `filepath.py`, `edit_control.py`, `bookmarks.py` and `programs.py` must stay free of NVDA imports so they can be tested directly. NVDA-specific code goes in `__init__.py`.
- `analyzer.py`, `snippets.py`, `editing.py`, `problems.py`, `filepath.py`, `edit_control.py`, `bookmarks.py`, `programs.py` and `undo.py` must stay free of NVDA imports so they can be tested directly. NVDA-specific code goes in `__init__.py`.
- The tests run on Linux in CI, so Windows-only calls (ctypes.windll, winreg) must happen only when a function is called, and tests must replace them (see `tests/test_programs.py`).
- `addon/sounds/*.wav` are Visual Studio Code's accessibility signal sounds (MIT, see `addon/sounds/LICENSE-vscode.txt`), converted from MP3 and trimmed. NVDA plays them with `nvwave.playWaveFile`; keep them 16-bit PCM WAV.
- Commands that change text only run in a writable, multi-line Win32 edit control (classic Notepad), through `edit_control.replace`, which uses EM_SETSEL and EM_REPLACESEL (one undo step, offsets in UTF-16 units). Elsewhere their keys pass through unchanged. `tests/test_plugin_v040.py` replaces `edit_control.replace` with a fake that edits the test editor's text.
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Version 0.4.1

### 馃帀 New

- **Undo and redo many steps in Windows 10's Notepad**, like in VS Code. Notepad itself keeps only one step, and its second control+Z brings the change back. Now **control+Z** goes back step by step and **control+Y** (or control+shift+Z) forward again. A step is a run of typing (it ends when you pause or move to another line) or one Code Compass command, such as a line move or a rename. The changed line is read, and going back to the saved text clears the "*" in the title. It can be turned off in the settings.

## Version 0.4.0

The first public release. Coding in Notepad now works much more like a code editor such as VS Code.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Editing in Windows 10 Notepad:
- **Automatic indentation** on Enter and closing brackets, **Tab and shift+Tab** on several lines, **control+/** to comment.
- **control+space** completion from the file's names, **control+shift+space** for a function's parameters.
- **Delete, move and duplicate lines**, and **F2** to rename a name across the file.
- **Undo and redo many steps** with control+Z and control+Y; Notepad alone keeps only one.
- **Snippets**: save code you reuse and insert it later, indented to fit.

Comments and strings are ignored when counting brackets; Python and YAML blocks also follow indentation. Messages are in English or Indonesian, chosen separately from NVDA's language. NVDA+shift+K then H lists the commands that work in any editor.
Expand Down
4 changes: 3 additions & 1 deletion addon/doc/en/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ A line with a problem plays a low buzz after its level tone. See Problems below.
## Editing in Windows 10 Notepad

- **Automatic indentation**: Enter keeps the line's indentation, adds a level after an opening bracket (or `:` in Python), and goes back a level after `return`, `pass`, `break`, `continue` or `raise` in Python. Enter between a pair such as `{}` puts the closing bracket on its own line and the caret on the line between. A closing bracket typed first on a line moves back to line up with its opening bracket.
- **Undo and redo many steps**: control+Z goes back one step at a time, as far as you like, and control+Y (or control+shift+Z) goes forward again. A step is a run of typing, which ends when you pause for a second or move to another line, or one Code Compass command such as a line move, a comment or a rename. The line that changed is read. Going back to the text that is saved clears the "*" in the title. The steps last while the file is open; Notepad itself keeps only one.
- **Closing brackets and quotes** (off by default, see Settings): typing `(` adds `)` after the caret; typing the closing one over it does not double it.
- **Tab and shift+Tab** with several lines selected indent or outdent them. Shift+Tab with nothing selected outdents the caret's line. A plain Tab still types a tab.
- **control+/** comments or uncomments the selected lines, or the caret's line, with the language's comment (`#`, `//`, `--`).
Expand Down Expand Up @@ -164,6 +165,7 @@ NVDA menu, Preferences, Settings, Code Compass:
- Examine code while typing: off, play a sound for new problems (the default), or play a sound and say them.
- Say the function or class the caret moves into.
- Automatic indentation on Enter and closing brackets (Windows 10 Notepad).
- Undo and redo many steps with control+Z and control+Y (Windows 10 Notepad). On by default.
- Add closing brackets and quotes automatically (Windows 10 Notepad). Off by default. Typing the closing character yourself types over the one that was added, and Backspace right after an opening bracket removes both.
- Tone pitch for level 1, and how many semitones higher each level is.
- Applications with level tones and quick keys. The NVDA+shift+K commands work in any text editor.
Expand All @@ -174,6 +176,6 @@ NVDA menu, Preferences, Settings, Code Compass:
- Windows 11's Notepad is a different program: level tones, navigation and reading commands work there, but commands that change text do not.
- VS Code only exposes part of a file to screen readers, so levels there can be wrong. VS Code is not enabled by default.
- The outline and function moves find declarations with patterns, not a full parser. Unusual code styles may be missed.
- Notepad keeps only one step of undo: control+Z undoes the last Code Compass change, not the one before.
- Undo steps are kept while NVDA runs: after restarting NVDA, or with the setting turned off, control+Z is Notepad's own single step again.
- Python syntax errors come from Python's own parser, which reports only the first one in a file.
- Code inside strings is understood for Python f-strings, JavaScript template literals and Swift's \\( ). In other languages' interpolated strings, such as C#'s `$"{name}"` or Kotlin's and Dart's `"${name}"`, the name is text: rename, uses and completion skip it there.
4 changes: 3 additions & 1 deletion addon/doc/id/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Baris yang ada masalahnya bunyi dengung rendah sesudah nada levelnya. Lihat bagi
## Ngedit di Notepad Windows 10

- **Indentasi otomatis**: Enter ngikutin indentasi baris sekarang, nambah satu level sesudah kurung buka (atau `:` di Python), dan mundur satu level sesudah `return`, `pass`, `break`, `continue`, atau `raise` di Python. Enter di antara pasangan kayak `{}` naruh kurung tutupnya di baris sendiri, dan kursornya di baris tengah. Kurung tutup yang diketik paling awal di sebuah baris otomatis mundur sejajar sama kurung bukanya.
- **Undo dan redo berkali-kali**: control+Z mundur satu langkah, sejauh yang kamu mau, dan control+Y (atau control+shift+Z) maju lagi. Satu langkah itu satu rombongan ketikan (selesai kalau kamu berhenti sedetik atau pindah baris), atau satu perintah Code Compass, misalnya pindah baris, komentar, atau rename. Baris yang berubah dibacain. Kalau balik ke teks yang udah disimpan, tanda "*" di judul ilang. Langkah-langkahnya ada selama file-nya kebuka; Notepad sendiri cuma nyimpen satu.
- **Kurung tutup dan kutip otomatis** (mati secara default, lihat Pengaturan): ngetik `(` langsung nambah `)` sesudah kursor, dan ngetik kurung tutupnya nggak bikin dobel.
- **Tab dan shift+Tab** pas beberapa baris dipilih: nambah atau ngurangin indentasi baris-baris itu. Shift+Tab tanpa pilihan ngurangin indentasi baris kursor. Tab biasa tetap ngetik tab.
- **control+/**: ngomentarin atau batalin komentar di baris yang dipilih, atau di baris kursor, pakai tanda komentar bahasanya (`#`, `//`, `--`).
Expand Down Expand Up @@ -164,6 +165,7 @@ Menu NVDA, Preferences, Settings, Code Compass:
- Periksa kode saat mengetik: mati, bunyiin suara buat masalah baru (default), atau bunyiin suara sekalian dibacain.
- Sebutin fungsi atau class yang dimasuki kursor.
- Indentasi otomatis saat Enter dan kurung tutup (Notepad Windows 10).
- Undo dan redo berkali-kali dengan control+Z dan control+Y (Notepad Windows 10). Nyala secara default.
- Tambahin kurung tutup dan kutip otomatis (Notepad Windows 10). Mati secara default. Kalau kamu ngetik sendiri karakter penutupnya, yang tadi ditambahin bakal ditimpa, dan Backspace persis setelah kurung buka ngapus dua-duanya.
- Tinggi nada level 1, dan berapa semitone naiknya tiap level.
- Aplikasi yang dapat nada level dan tombol cepat. Perintah lewat NVDA+shift+K jalan di semua editor teks.
Expand All @@ -174,6 +176,6 @@ Menu NVDA, Preferences, Settings, Code Compass:
- Notepad Windows 11 itu program yang beda: nada level, navigasi, dan perintah yang cuma baca jalan di sana, tapi perintah yang ngubah teks nggak.
- VS Code cuma ngasih sebagian isi file ke screen reader, jadi levelnya bisa salah di sana. VS Code nggak aktif secara default.
- Outline dan lompat per fungsi nyari deklarasi pakai pola, bukan parser lengkap. Gaya penulisan kode yang nggak biasa bisa kelewat.
- Notepad cuma bisa undo satu langkah: control+Z ngebatalin perubahan Code Compass yang terakhir, bukan yang sebelumnya.
- Langkah undo disimpan selama NVDA jalan: habis NVDA di-restart, atau kalau pengaturannya dimatiin, control+Z balik jadi undo bawaan Notepad yang cuma satu langkah.
- Error sintaks Python dicek pakai parser Python sendiri, yang cuma ngelaporin error pertama di satu file.
- Kode di dalam string dikenali buat f-string Python, template literal JavaScript, dan \\( ) di Swift. Di string interpolasi bahasa lain, misalnya `$"{name}"` di C# atau `"${name}"` di Kotlin dan Dart, namanya dianggap teks: rename, daftar pemakaian, dan autocomplete ngelewatin nama di situ.
Loading
Loading