Skip to content

DayOne journal tag search fails for tags that don't use the first symbol in the config's tagsymbols #1658

Description

@micahellison

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

Only the first character of the tagsymbols value in the config file is used when searching for tags in DayOne journals. Other journal types are fine.

Expected Behavior

Any tag starting with any tag symbol should be searchable in a DayOne jounal.

Repro Steps

With my DayOne test journal "dayone", I should be able to run the following:

jrnl dayone Here is a new entry with a @tag

Then, after running this, I should see that entry:

jrnl dayone @tag

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=['dayone', '@tag'])
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, 'editor': 'subl -w', 'encrypt': False, 'highlight': True, 'indent_character': '|', 'journals': ********************************** 'dayone': {'journal': 'C:\\Users\\micah\\Documents\\jrnl\\testing\\dayone.dayone'}}, 'linewrap': 79, 'tagsymbols': '#@', 'template': False, 'timeformat': '%F %r', 'version': 'v3.3'}"
DEBUG    root         Using journal name: dayone
DEBUG    root         Updating configuration with specific journal overrides {'journal': 'C:\\Users\\micah\\Documents\\jrnl\\testing\\dayone.dayone'}
┌────────────────────┐
│  no entries found  │
└────────────────────┘

Other Information

In DayOneJournal.py, the faulty line is:

self.config["tagsymbols"][0] + tag.lower()

That [0] is grabbing the first of the tagsymbols and ignoring the rest.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    📌This can't go stalebugSomething isn't workingready for prOkay to start work. Feel free to ask questions.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions