Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split "Custom" text on only newlines [suggestion] #34

Open
izaakm opened this issue Sep 8, 2023 · 2 comments
Open

Split "Custom" text on only newlines [suggestion] #34

izaakm opened this issue Sep 8, 2023 · 2 comments

Comments

@izaakm
Copy link

izaakm commented Sep 8, 2023

My goal may be different than the intended use. I'd like to practice typing code, and it would be convenient to be able to paste code directly into the custom text. Splitting on all white space works but produces some odd character combinations. Having the option to split only on newlines would, I think, suffice for what I'm trying to do.

@ranelpadon
Copy link
Owner

Could you paste here the sample code you're trying to practice on?

@izaakm
Copy link
Author

izaakm commented Sep 8, 2023

Here's an example, pretty trivial:

#!/usr/bin/env bash

set -e

todofile="${TODOFILE:-${XDG_DATA_HOME}/todo/todo.md}"
tododir="$(dirname $todofile)"

fetch() {
    if [[ -d $tododir ]] ; then
        echo "[INFO] FETCH"
        git -C "$tododir" fetch || echo "[WARNING] fetch FAILED"
    fi
}

pull() {
    if [[ -d $tododir ]] ; then
        echo "[INFO] PULL"
        git -C "$tododir" pull --rebase
    fi
}

push() {
    if [[ -d $tododir ]] ; then
        echo "[INFO] PUSH"
        git -C "$tododir" push
    fi
}

This should be sufficient to demonstrate the 'problem' I'm having. Using this, you will end up with instances where you just end up practicing typing lots of open/close brackets, but I'd like to get more realistic practice by typing whole lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants