mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 16:48:31 +02:00
Fix small bug related to starring an entry with a date
If a date was given with an entry, and the star was also was added, the star wouldn't be recognized if it was at the start of the title. Example that didn't work, but now works with this fix: jrnl "saturday: *Title words." This is to be consistent in starring functionality with and without a date in the entry.
This commit is contained in:
parent
a54ed90259
commit
bfd1cf5eb8
3 changed files with 7 additions and 2 deletions
|
@ -279,7 +279,12 @@ class Journal:
|
||||||
if date: # Parsed successfully, strip that from the raw text
|
if date: # Parsed successfully, strip that from the raw text
|
||||||
starred = raw[:colon_pos].strip().endswith("*")
|
starred = raw[:colon_pos].strip().endswith("*")
|
||||||
raw = raw[colon_pos + 1 :].strip()
|
raw = raw[colon_pos + 1 :].strip()
|
||||||
starred = starred or first_line.startswith("*") or first_line.endswith("*")
|
starred = (
|
||||||
|
starred
|
||||||
|
or first_line.startswith("*")
|
||||||
|
or first_line.endswith("*")
|
||||||
|
or raw.startswith("*")
|
||||||
|
)
|
||||||
if not date: # Still nothing? Meh, just live in the moment.
|
if not date: # Still nothing? Meh, just live in the moment.
|
||||||
date = time.parse("now")
|
date = time.parse("now")
|
||||||
entry = Entry.Entry(self, date, raw, starred=starred)
|
entry = Entry.Entry(self, date, raw, starred=starred)
|
||||||
|
|
|
@ -25,7 +25,7 @@ import platform
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from . import install, plugins, util
|
from . import install, plugins, util
|
||||||
from .parsing import parse_args
|
from .parse_args import parse_args
|
||||||
from .Journal import PlainJournal, open_journal
|
from .Journal import PlainJournal, open_journal
|
||||||
from .util import WARNING_COLOR, ERROR_COLOR, RESET_COLOR, UserAbort
|
from .util import WARNING_COLOR, ERROR_COLOR, RESET_COLOR, UserAbort
|
||||||
from .util import get_journal_name
|
from .util import get_journal_name
|
||||||
|
|
Loading…
Add table
Reference in a new issue