quickadd icon indicating copy to clipboard operation
quickadd copied to clipboard

[FEATURE REQUEST] Support append to line in Kanban boards

Open dcoales opened this issue 4 years ago • 0 comments

I have a QuickAdd macro that pops up a dialog box into which I can type a number and QuickAdd inserts a full URL to Atlassian with the number embedded as a Jira number. This is inserted into the current line. I use this a lot in standard markdown files and it would be awesome if I could do the same thing in kanban boards.

At present, whenever I try, I get the message "unable to append to the current line" which appears to be because QuickAdd is always looking for an active view of type Markdown. According to the debugger the first log message is being triggered rather than the one in the catch in the function below.

function appendToCurrentLine(toAppend, app) {
    try {
        const activeView = app.workspace.getActiveViewOfType(obsidian.MarkdownView);
        if (!activeView) {
            log.logError(`unable to append '${toAppend}' to current line.`);
            return;
        }
        activeView.editor.replaceSelection(toAppend);
    }
    catch (_a) {
        log.logError(`unable to append '${toAppend}' to current line.`);
    }
}

Would it even be possible to have a version which could detect the current line in a kanban view and append there ?

dcoales avatar Nov 10 '21 13:11 dcoales