Open micahellison opened 1 year ago
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
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.
tagsymbols
Any tag starting with any tag symbol should be searchable in a DayOne jounal.
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 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 │ └────────────────────┘
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.
I think this is ready for a PR if anyone is interested. A resolution should also include a test for each tag symbol. It wouldn't hurt for that test to run on all journal types.
Diagnostic output
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:
Then, after running this, I should see that entry:
Debug output
Other Information
In DayOneJournal.py, the faulty line is:
That [0] is grabbing the first of the
tagsymbols
and ignoring the rest.