Re: mcedit bug



Matthias,

> first, thanks for your quick answer. And you are right; C style comments
> can be quite problematic. But using conditional preprocessor directives
> can cause quite similar problems; just imagine there is a single #if or
> #ifdef inside the block you want to hide! By the way, only C++ style
> comments really seem to be completely problem-free :-(

That situation is rather rare. At least much less common than finding a
single commentline. 
By the way, optimally, I would like it to add something like this:
#if FAST_COPY_TECHNIQUE
.
.
.
#endif /* FAST_COPY_TECHNIQUE */

where "FAST_COPY_TECHNIQUE" is given as the argument of the user
function.


> But that wasn't quite the problem I had. Do you really mean that it's
> the better way to hard-code moving the cursor to the beginning of the
> line than to leave this decision to the user? You wrote:

No, it's better to insert a newline, but only if the cursor is not on
the start of the line. The problem is, that you cannot know this from
the $TEMPFILE

> I don't think that this is a problem. I would (and have :-) implement it
> like this:
> 
> ---
> + f \.h$ | f \.c$ | f \.cc$ | f \.C$ | f \.H$ | f \.cpp$
> 6       #if 0 ... #endif
>         TEMPFILE="$(dirname %b)/cooledit.temp"
>         echo -e "\n#if 0" > $TEMPFILE
>         cat %b >> $TEMPFILE
>         cat $TEMPFILE > %b
>         echo -e "\n#endif" >> %b
> ---
Exactly! This should work. However, if started on empty lines, there
will be a couple of unnecessary empty lines.
Also, putting them in, is easy. But how do you get the extra "\n"'s out?
There is off course no telling whether the original file had these extra
"\n"'s....

> PS: Is `word completion' within the editor a subject for you at all?
? what do you mean by `word completion` do you mean that when I type
  ret<ALT-TAB>
I get
  return 
when editing c-files?

If that's what you mean, perhaps....
Not for c-files though. I defined macros to enter standard clauses like
these:

<ALT-I>
gives
if ()
 {

 }
else
 {

 }



However, it may be practical for other file-types. I really think it
should be a filetype-specific functionality. I don't need to complete
the word return in this mail. Although, I used the word "return" quite a
lot in this mail already ;-)

Steef



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]