pimutils / pimutils/khal

line wrapping

Open
#1,426 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
3.1k
Forks
233
Avg merge
1h 44m
Merged PRs (30d)
1

Description

Three-part suggestion.

One, add --width to khal list.

Two, add a configurable continuation indent to the wrapping (textwrap does have subsequent_indent, but the indent should not be highlighted, so you’ll probably wish to do it manually in color_wrap).

Three, make things actually line up. Right now, I have:

Today, 12.08.2025
↔ Urlaub $name
⇥ testgt2 mit einem sehr langen Namen lorem ipsum dolor und so weiter und so fort et cetera etm…
↔ Urlaub $othername
 testgttermin mit einem sehr langen Namen lorem ipsum dolor und so weiter und so fort et cetera etm…
Tomorrow, 13.08.2025
↔ Urlaub $othername
17:00:00-18:00:00 Testtermin mit einem sehr langen Namen lorem ipsum dolor und so weiter und so fort et cetera etm…

I’d suggest adding before nōn-range whole-day events and before nōn-whole-day events, so they line up, plus continuation indent:

Today, 12.08.2025
↔ Urlaub $name
⇥ testgt2 mit einem sehr langen Namen lorem ipsum dolor und so weiter
  und so fort et cetera etm…
↔ Urlaub $othername
• testgttermin mit einem sehr langen Namen lorem ipsum dolor und so
  weiter und so fort et cetera etm…
Tomorrow, 13.08.2025
↔ Urlaub $othername
• 17:00:00-18:00:00 Testtermin mit einem sehr langen Namen lorem ipsum
  dolor und so weiter und so fort et cetera etm…

For the ASCII case, of course equivalent, just wider indent.

In this case, you might not even need the continuation indent configurable, but OTOH since people can change the formatting, you may wish to keep it so.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the khal list entry point and inspect the color_wrap usage, along with Python's textwrap behavior. Reproduce the Unicode and ASCII examples from the issue, then verify that width, continuation indentation, event markers, and aligned output behave as specified.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.