This is not very deep tested. Just a quick hack to add a feature.
While writing C/C++, sometimes it is convenient after typing the name of a pointer not to type "->" but a simple "." and SE will change this to "->" - if it is clear, that the variable is a pointer.
The module codehelp.e can be changed to support this feature. Beneath is a first proposal for additional code.
The modified module is attached to this post.
I know, modifying product modules is not very polite. So take my excuse, this is just to proof, that it is probably easy to add.
//////////////////////////////////////////////////////////////////////////////////////////////////
//since 2014-11-13 ewendt : replace operator . with -> if . is used on a pointer to a struct
//
// This is useful for C/C++.
// while typing a '.' after the name of a pointer the operator triggers list_symbols(), which
// calls _do_list_members() which will test for members and do find that a pointer can not
// access members via '.'. An error msg is constructed for this. At this point the error message is
// tested for the the format string index and operator for this special condition and the '.'
// operator ist changed to '->'. list_symbols() ist called (recursive) to list the members
// the pointer have access to.
//
// This works for example for code like this
//
// struct S { int a,b; }
// S s;
// S *ps;
// int *i;
//
// Try typing
// s.
// ps. <- the operator should be replaced with '->'
// i.
//
// If the symbol can not be resoveld, another error msg is used and the operator remains unchanged.
//
//--------------------------------------------------------------------------------------------------
//
// This is to place in codehelp.e (SlickEdit 2014 Version 19.0.0.14) in function
// '_do_list_members(..)' after line 3701 :
// 3686: do {
// 3687: status = AutoCompleteUpdateInfo(true,
// ...
// 3700: if (status < 0) {
// 3701: msg := _CodeHelpRC(status, errorArgs);
//
//--------------------------------------------------------------------------------------------------
//
//- say(msg);
//
// testing for status text "Attempt to use operator '.', but variable '<VARIABLE>' is a pointer"
if (status == -4607) { // format string
if (errorArgs._length()==3) { // correct count of args
if (errorArgs[1] == '.') { // and the operator arg holds the '.'
//in this case, the operator can be changed from '.' to '->'
//- say("replace operator '.' with '->'");
left();
_delete_char();
_insert_text("->");
list_symbols(); // yes, recursiv, sorry - but now the members are listed
}
}
}
//end of since 2014-11-13
//////////////////////////////////////////////////////////////////////////////////////////////////