Help for the quick translucency shortcuts. Fix a bug in Help where a hotkey highlight was on wrong position if an escaped character preceded it (The case never occured in 2.0)

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@866 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud
2009-06-15 18:41:36 +00:00
parent 69dbed8d04
commit dad7e3d363
2 changed files with 32 additions and 0 deletions

14
help.c
View File

@@ -278,7 +278,21 @@ void Display_help(void)
else if (line_type == 'K')
{
const char *hyperlink;
const char * escaped_percent_pos;
// Determine link position:
link_position = strstr(line,"%s") - line;
// Adjust for any escaped %% that would precede it.
escaped_percent_pos = line;
do
{
escaped_percent_pos = strstr(escaped_percent_pos,"%%");
if (escaped_percent_pos && escaped_percent_pos - line < link_position)
{
link_position--;
escaped_percent_pos+=2;
}
} while (escaped_percent_pos);
//
hyperlink=Keyboard_shortcut_value(Help_section[Current_help_section].Help_table[start_line + line_index].Line_parameter);
link_size=strlen(hyperlink);
snprintf(buffer, 44, line, hyperlink);