Hi,
Can anyone show me how I can get the current section into a _str variable?
If possible this would work regardless of the type of selection, single-line, multiline
etc.
I use the following; code but this does NOT work when the selection spans more
than line?
static _str GetSelectionOrWordAtCursor()
{
int first_col, last_col, buf_id;
_str word, line;
if (!_begin_select_compare() && !_end_select_compare())
{ /* get text out of selection */
_get_selinfo(first_col, last_col, buf_id);
get_line(line);
if (_select_type('', 'I'))
++last_col;
if (_select_type() == 'LINE')
word = line;
else
word = expand_tabs(line, first_col, last_col - first_col);
_deselect();
}
else
{
deselect();
word = cur_word(first_col, '', 1);
}
return word;
}
Thanks,
Mark