jgclark / NotePlan-tools

This Ruby script adds functionality to the [NotePlan app](https://noteplan.co/). Particularly when run frequently, this provides a more flexible system for repeating tasks, allows for due dates to be expressed as offsets which allows for templates, and moves or files items from Daily files to Note files. It incorporates an ealier script to 'clean' or tidy up NotePlan's data files.
26 stars 6 forks source link

If the first line of a file is an "empty header" it won't be deleted on cleanup #33

Closed BMStroh closed 3 years ago

BMStroh commented 3 years ago

Probably an unusual case, but the fix is on line 692 - add || n.zero? so the loop makes it back to the first entry in the array.

later_header_level = this_header_level = 0
at_eof = 1
while n.positive? || n.zero?
  line = @lines[n]
  # find header lines
jgclark commented 3 years ago

Thanks. Have pushed an update that includes this.