Thanks Clark, using down() made the difference!
Below is my function now, appreciate any comments you have on it.
It no longer gets stuck regardless of whether or not the dsay() are commented out.
// Reads a line from the current document and takes into account if the line
// is getting wrapped, it will get the full line including all the wraps.
// See: https://community.slickedit.com/index.php?topic=19548.new;topicseen#new
static _str get_full_line()
{
_str line = "";
while ( true )
{
_str linePortion;
get_line(linePortion);
dsay("linePortion: " linePortion);
line = line linePortion;
if ( !(_lineflags()&VSLF_EOL_MISSING ))
{
// This is the end of the line, it is no longer wrapped or truncated, so return it
// Caller is responsible for calling down() to advance to next line.
return line;
}
// Being here means that get_line() didn't read the full line, it wrapped it to
// the next line in the editor, so we will need to read the next line.
dsay("not end of line");
// Call down() to go to the next line.
if (down())
{
// This means we got to the end of the file
return line;
}
}
// Should never reach here.
return line;
}