Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starting an entry with multiple line breaks splits the end of the first line by the number of line breaks #1676

Open
micahellison opened this issue Feb 11, 2023 · 0 comments · May be fixed by #1874
Labels
bug Something isn't working 📌 This can't go stale
Milestone

Comments

@micahellison
Copy link
Member

Diagnostic output

jrnl: v3.3
Python: 3.11.1 (tags/v3.11.1:a7a450f, Dec 6 2022, 19:58:39) [MSC v.1934 64 bit (AMD64)]
OS: Windows 10

Current Behavior

Run jrnl by itself, then, in your editor, add at least two line breaks and type a sentence. After you save, it will insert a single line break before the end of your sentence. The distance before the end is the number of prepended line breaks minus 1.

Expected Behavior

The entry shouldn't be cut off just because of prepended line breaks.

Repro Steps

  • Run jrnl
  • In your editor, press enter twice, then type "entry"
  • Run jrnl -1
  • You'll see something like this:
[2023-02-11 11:47:35 AM] entr
y
  • Run jrnl
  • In your editor, press enter three times, then type "entry"
  • Run jrnl -1
  • You'll see something like this:
[2023-02-11 11:48:04 AM] ent
ry

Debug output

DEBUG    root         Parsed args: Namespace(debug=True, preconfig_cmd=None, postconfig_cmd=None, filename=None, on_date=None, today_in_history=False, month=None, day=None, year=None, start_date=None, end_date=None, contains=None, strict=False, starred=False, limit=None, excluded=[], edit=False, delete=False, change_time=None, export=False, tags=False, short=False, config_override=[], config_file_path='', text=[])
DEBUG    root         Reading configuration from file C:\Users\micah\.config\jrnl\jrnl.yaml
DEBUG    root         Using configuration "{'colors': {'body': 'none', 'date': 'none', 'tags': 'none', 'title': 'none'}, 'default_hour': 9, 'default_minute': 0, 'display_format': 'text', 'editor': 'subl -w', 'encrypt': False, 'highlight': True, 'indent_character': '|', 'journals': {**************}, 'linewrap': 79, 'tagsymbols': '#@', 'template': False, 'timeformat': '%F %r', 'version': 'v3.3'}"
DEBUG    root         Using journal name: default
DEBUG    root         Updating configuration with specific journal overrides {'encrypt': False, 'journal': 'C:\\Users\\micah\\Documents\\jrnl\\default.txt'}
DEBUG    root         opened PlainJournal with 11 entries
DEBUG    root         Write mode: starting
DEBUG    root         Write mode: opening editor
DEBUG    root         Write mode: loading template for entry
DEBUG    root         Write mode: no template configured
DEBUG    root         Write mode: appending raw text to journal "default":

entry
DEBUG    root         Write mode: completed journal.write()

Other Information

I also tested this with the default stdin editor and saw the behavior. @wren reproduced this on a Mac also so it's not Windows-specific.

@micahellison micahellison added bug Something isn't working 🆕 New! 📌 This can't go stale and removed 🆕 New! labels Feb 11, 2023
@micahellison micahellison added this to the Backlog milestone Feb 11, 2023
@comkieffer comkieffer linked a pull request Mar 23, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 📌 This can't go stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant