samg / timetrap

Simple command line timetracker
http://rubygems.org/gems/timetrap
Other
1.48k stars 115 forks source link

Improve text formatter behaviour for linebreaks. #148

Closed patrickdavey closed 7 years ago

patrickdavey commented 7 years ago

When an external note editor is being used, the user can easily add linebreaks. When these are displayed in the terminal though, lining them up is currently a little broken.

For example, given this note text:

chatting with bob about upcoming task, district sharing of images, how the user settings currently works etc. Discussing the fingerprinting / cache busting issue with CKEDITOR, suggesting perhaps looking into forking the rubygem and seeing if we can work in our own changes, however hard that might be.

When this is displayed it (currently) looks like this:

60000 Sun Oct 05, 2008   16:00:00 - 18:00:00   2:00:00    chatting with bob about upcoming task, district sharing
                                                          of images, how the
                                                          user settings currently works etc. Discussing the fingerprinting
                                                          / cache
                                                          busting issue with CKEDITOR, suggesting perhaps looking
                                                          into forking the
                                                          rubygem and seeing if we can work in our own changes,
                                                          however hard that might
                                                          be.

With this change, we use the ActiveSupport word_wrap method (copied wholesale) and it does a much nicer job of it

60000 Sun Oct 05, 2008   16:00:00 - 18:00:00   2:00:00    chatting with bob about upcoming task, district
                                                          sharing of images, how the user settings currently
                                                          works etc. Discussing the fingerprinting / cache
                                                          busting issue with CKEDITOR, suggesting perhaps
                                                          looking into forking the rubygem and seeing if we
                                                          can work in our own changes, however hard that
                                                          might be.
samg commented 7 years ago

Thanks! Just released this in gem 1.14.0.