DistributedProofreaders / guiguts

Perl/Tk text editor designed for editing and formatting public domain material for inclusion at Project Gutenberg
GNU General Public License v2.0
9 stars 10 forks source link

Deleting a Page Separator when there are none left causes command window error #316

Closed windymilla closed 4 years ago

windymilla commented 4 years ago

Describe the bug Described here, by holding down the D key when Fixing Page Separators, it is possible to cause GG to output

Use of uninitialized value $pagesep in pattern match (m//) at C:/Users/<redacted>/Desktop/DP/Tools/guiguts-1.1.1/lib/Guiguts/PageSeparators.pm line 248

To Reproduce Steps to reproduce the behavior:

  1. Open a file from the rounds in Guigut still containing Page Separators
  2. Open the Page Separator Fixup dialog
  3. Hold down the D (for Delete) key until all Page Separators have been deleted and keep holding it for a couple more seconds.
  4. See error in command window

Expected behavior Just do nothing when there are no Page Separators to delete

Environment

Additional context May not be in latest development version, or maybe screen timing updates have stopped the key stroke input from advancing beyond the processing. Anyway, the code should return a couple of lines before the error line if $pagesep is undefined.

windymilla commented 4 years ago

Already fixed by #241.