Author Topic: Can I detect Diff Mode to avoid "currently not allowed in Diff mode"  (Read 2642 times)

WadeHatler

  • Community Member
  • Posts: 19
  • Hero Points: 0
  • Been using VSlick since the dawn of time
I have a bunch of macros that override the basic functions for some standard keys.  For example, I have MyEnd which chops off any whitespace on the end of the file.  So far so good.

When in the DIFF editor, pressing END gives me the "currently not allowed in Diff mode" error because it doesn't know how to handle that command.  I can work around it by editing diffedit.e as per this post by re-remapping the command like this (2nd line).

Code: [Select]
   "end-line"                  =>diff_end_line,
   "MyEnd"                     =>diff_end_line,

That works OK, but it I'd prefer to keep the file in it's original condition.  Is there a way to either have a diff-mode key binding in keydefs.e, or alternatively is there some code I can put in MyEnd that would fix this?  For the moment, I'm planning to just bang in the aliases I need to handle, but it would be nice to know if we can make it work.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2899
  • Hero Points: 153
Re: Can I detect Diff Mode to avoid "currently not allowed in Diff mode"
« Reply #1 on: August 17, 2012, 12:49:59 PM »
Wade:

Unfortunately that table is static, so there is no easy way to add to it.

What if for v18 I added a global function that you could call with a name and function pointer, so that you could make a function call to add this?

WadeHatler

  • Community Member
  • Posts: 19
  • Hero Points: 0
  • Been using VSlick since the dawn of time
Re: Can I detect Diff Mode to avoid "currently not allowed in Diff mode"
« Reply #2 on: August 17, 2012, 03:18:03 PM »
That's probably not necessary.  Once I understood how to make the changes they were easy enough, and there are always a few changes to built in macros that I have to port forward.  It's all good.