Scite Open To Line

lua-users home
wiki

SciteOpenToLine

Compilers produce output like the following:

error in ../../foo/docs/html/gdiobj_8c-source.html:420:3

SciTE has a command to go to line 420, column 3 of gdiobj_8c-source.html.

scite gdiobj_8c-source.html -goto:420:3

For occasional use, that's fine. But this bash script accepts multiple filenames, colons and all.

It may be given a short name, such as "s", to save typing.

#!/bin/bash
: ${1?"Usage: scite [options] [filespec]"}
cmd="scite "
for x in "$@"; do
    if [[ "${x/://}" == "$x" ]]; then
        cmd="$cmd $x"
    else
        cmd="$cmd $(echo "$x"|sed -r 's/([^:]+):([^:]+):?([^:]+)?:?/\1 -goto:\2,\3/')"
    fi
done
eval $cmd &

RecentChanges · preferences
edit · history
Last edited March 26, 2019 12:44 am GMT (diff)