andmarti1424 / sc-im

sc-im - Spreadsheet Calculator Improvised -- An ncurses spreadsheet program for terminal
Other
4.81k stars 204 forks source link

Invalid row format error reported on folded text columns #734

Closed earthshrink closed 1 year ago

earthshrink commented 2 years ago

Per help file, run sc-im --quit_afterload --nocurses --export_txt examples/sc/wraps.sc. Invalid row format gets reported on stderr. Wondering if this exception is an obsolete internal consistency check.

andmarti1424 commented 2 years ago

Hello. An internal check seems wrong.

andmarti1424 commented 2 years ago

@earthshrink Please update to latest commit on dev branch and retry. Thanks.

earthshrink commented 2 years ago

Error message not seen with the dev branch. However, a different error is exposed on both main and dev branches with this single-cell sample file:

# This data file was generated by the Spreadsheet Calculator Improvised (sc-im)
# You almost certainly shouldn't edit it.

newsheet "Sheet1"
movetosheet "Sheet1"
offscr_sc_cols 0
offscr_sc_rows 0
nb_frozen_rows 0
nb_frozen_cols 0
nb_frozen_screenrows 0
nb_frozen_screencols 0
format 0 2
leftstring A0 = "hello, world!"
goto A1

The text export produces

hello, world!
ld!
andmarti1424 commented 2 years ago

I get this output with your file:

hello, wor
ld!
earthshrink commented 2 years ago

I had

set overlap = 1
set truncate = 0

in my scimrc. Removing scimrc gets the correct output like you have. Issue occurs with overlap = 1.

earthshrink commented 2 years ago

I just found a way to get a non-interactive but full colour rendering on the terminal, bypassing the above issue.

while getopts "h:w:" opt
do
    case $opt in
    "h")
        stty rows $OPTARG
        ;;
    "w")
        stty columns $OPTARG
        ;;
    esac
done
shift $((OPTIND-1))
socat - EXEC:"scim $1",pty,setsid,ctty,sigquit<<EOF
EOF
stty sane
tput cnorm