mindforger icon indicating copy to clipboard operation
mindforger copied to clipboard

[Bug] Cannot link-complete notes that start with digits

Open djsudduth opened this issue 2 years ago • 3 comments

Bug description: Many of my research notes start with year such as "2011 - Johnson et al". Using the ctrl-/ for link completion does not bring up the list of notes. Only non-numeric text will pop up a link completion list.

Expected behaviour: Start typing "20" and press ctrl-/ to see any and all notes starting with years text "2000 - ..." to "2022 - ...."

Environment: Windows 10 desktop

  • MindForger version: 1.54.0
  • Operating system: Windows 10
  • Git SHA (in case of nightly/custom build): ...

**Steps to reproduce :

  1. Create notes - "2010 - Adams" and "2011 - Johnson"
  2. Start a new note and while in the editor typing "2" or "20" press ctrl-/

Screenshots: N/A

Error message or log: N/A

djsudduth avatar Mar 22 '22 20:03 djsudduth

Looks like the last line pasted here is the problem code in getCompletionPrefix() in note_editor_view.cpp:

const QString NoteEditorView::getCompletionPrefix()
{
    QTextCursor cursor = textCursor();
    cursor.select(QTextCursor::WordUnderCursor);
    const QString completionPrefix = cursor.selectedText();
    if(!completionPrefix.isEmpty()
       && completionPrefix.at(completionPrefix.length()-1).isLetter()

I'm not sure if there is a requirement for the completionPrefix char to be isLetter() - I think isLetterOrNumber() should work here.

Maybe I can get my dev environment up and do a pull request - but that won't happen for a while.

djsudduth avatar Mar 23 '22 19:03 djsudduth

@djsudduth thank you for 🐞- I will look into that.

dvorka avatar Apr 03 '22 07:04 dvorka