Author Topic: Command '...' currently not allowed in Diff mode  (Read 5574 times)

at5dapa1

  • Senior Community Member
  • Posts: 232
  • Hero Points: 22
Command '...' currently not allowed in Diff mode
« on: November 14, 2006, 08:19:39 am »
Is it possible to call macros inside Diffzilla?

For example in some places I have to surround the code with #ifdef ... #endif, and for this I have a macro:
Code: [Select]
_command my_surround_with_SSI() name_info(','VSARG2_MACRO|VSARG2_MARK|VSARG2_REQUIRES_MDI_EDITORCTL)
{
    surround_with('#SSI');
}
binded to Alt+3.

But when I want to call it from Diffzilla I get a SlickEdit dialog box: "Command 'my-surround-with-SSI' currently not allowed in Diff mode"! I suspect is something wrong with the arguments of the macro (VSARG2_MACRO|VSARG2_MARK|VSARG2_REQUIRES_MDI_EDITORCTL) but I tried 0 and 0xFFFFFFFF and the same result.

Can somebody help, please?
Thank you very much,
Daniel

hs2

  • Senior Community Member
  • Posts: 2754
  • Hero Points: 291
Re: Command '...' currently not allowed in Diff mode
« Reply #1 on: November 14, 2006, 05:12:09 pm »
Diffzilla (and Refactor results) implement their own macro support independently from the Editor.
But you may patch diffedit.e (resp. refactorgui.e) to add some of your favourite macros (as I did).
Code: [Select]
// HS2: prototypes of add. macros
_command void word_toggle();
_command void list_clipboards();
...
static typeless DiffCommands:[]={
   "wh"                        =>wh,
   "list-symbols"              =>list_symbols,
   ...
   // HS2: add. macros
   "word-toggle"               =>word_toggle,
   "list-clipboards"           =>list_clipboards,
   ...
}

I also added some shortcuts for Block / Line merge ops. I'm used to ...
[line 1348]
Code: [Select]
...
_ctlfile2.'C-S-F6'()
{
   if ( _DiffGetNextDiffMissing()!=1 ) {
      call_event(_ctlprev_difference,LBUTTON_UP);
   }
}

// HS2: F8 / F9 for BLOCK>> / <<BLOCK and SHIFT-F8 / SHIFT-F9 for LINE>> / <<LINE
_ctlfile1.'F8'()
{
   _ctlcopy_right.call_event(_ctlcopy_right,LBUTTON_UP);
}
_ctlfile2.'F8'()
{
   _ctlcopy_right.call_event(_ctlcopy_right,LBUTTON_UP);
}
_ctlfile1.'S-F8'()
{
   _ctlcopy_right_line.call_event(_ctlcopy_right_line,LBUTTON_UP);
}
_ctlfile2.'S-F8'()
{
   _ctlcopy_right_line.call_event(_ctlcopy_right_line,LBUTTON_UP);
}

_ctlfile1.'F9'()
{
   _ctlcopy_left.call_event(_ctlcopy_left,LBUTTON_UP);
}
_ctlfile2.'F9'()
{
   _ctlcopy_left.call_event(_ctlcopy_left,LBUTTON_UP);
}
_ctlfile1.'S-F9'()
{
   _ctlcopy_left_line.call_event(_ctlcopy_left_line,LBUTTON_UP);
}
_ctlfile2.'S-F9'()
{
   _ctlcopy_left_line.call_event(_ctlcopy_left_line,LBUTTON_UP);
}

HS2

at5dapa1

  • Senior Community Member
  • Posts: 232
  • Hero Points: 22
Re: Command '...' currently not allowed in Diff mode
« Reply #2 on: November 14, 2006, 05:46:57 pm »
Thank you very much hs2!