Author Topic: Adaptive formatting not completely disabled?  (Read 6540 times)

evanratt

  • Senior Community Member
  • Posts: 300
  • Hero Points: 23
Adaptive formatting not completely disabled?
« on: April 23, 2008, 04:03:45 pm »
I very clearly have Adaptive Formatting disabled in my C/C++ options (and to be safe, I also have all of its sub-options disabled). However, I just had a C++ file that I opened and as soon as I started typing, the Adaptive Formatting dialog came up, asking if I wanted to apply some formatting change. Unfortunately, because I wasn't expecting the dialog, I hit Enter and skipped right through it, so I couldn't tell you what change it was proposing. I think this may have happened once before for me also, where a C++ file caused Adaptive Formatting to activate, even though it's supposed to be disabled. Sorry I don't have any more details, but as I said, I was typing and not expecting the dialog, so skipped right on through. Needless to say, though, it seems like a bug for Adaptive formatting to try to do anything when I have it turned off.

-Evan

Sandra

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 754
  • Hero Points: 35
Re: Adaptive formatting not completely disabled?
« Reply #1 on: April 23, 2008, 05:16:25 pm »
It's just an enthusiastic feature.  8)

Someone else mentioned that they thought this was occurring, but they couldn't reproduce it reliably.  I'll play around with it and see if I can't get the behavior your describe.  Thanks!

evanratt

  • Senior Community Member
  • Posts: 300
  • Hero Points: 23
Re: Adaptive formatting not completely disabled?
« Reply #2 on: April 23, 2008, 05:32:29 pm »
It's got reason to be enthusiastic - it's a cool idea, and if I worked with multiple codebases with different coding styles, I'm sure I would have it enabled  :)

Thanks for checking into it - if it happens again and I have any more information, I'll let you know!

evanratt

  • Senior Community Member
  • Posts: 300
  • Hero Points: 23
Re: Adaptive formatting not completely disabled?
« Reply #3 on: June 09, 2008, 05:27:22 pm »
I was wondering if you've had any luck looking into this... it's recently been happening to me again, more frequently. I still have the option disabled, and all of the sub-options disabled for C/C++, and I am working on a C++ file...

Thanks,
Evan

Sandra

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 754
  • Hero Points: 35
Re: Adaptive formatting not completely disabled?
« Reply #4 on: June 09, 2008, 05:47:45 pm »
Try getting the latest hotfix (http://www.slickedit.com/content/view/506).  Make sure you get the updated required hotfix first.  The fix for this problem was included a while back, but I neglected to update this thread.  I'm sorry you've had to still struggle with it. 

The problem had to do with version control.  Adaptive Formatting would be turned off, but if you updated a file from source control, then it would turn itself on again.  If you find that the hotfix doesn't fix your woes, let me know and we'll see if we can come up with some reproducible steps.

evanratt

  • Senior Community Member
  • Posts: 300
  • Hero Points: 23
Re: Adaptive formatting not completely disabled?
« Reply #5 on: June 09, 2008, 05:59:37 pm »
Hmm... I am running the latest hotfix and the latest required hotfix. The problem seemed to go away for a while and just came back recently - is it possible the bug was accidentally reintroduced in a later hotfix? It does sound like the problem you found is at least close to what I'm experiencing; I just encountered the problem today after updating a file through version control outside of slickedit - I don't generally use slickedit's version control interface, as I haven't quite got it working perfectly with our custom version control system. Was the problem related to updating from source control, or just from updating a file outside of the editor and causing it to be reloaded? If it was related to just updating from source control within Slick, could something similar happen when reloading a file to to a change outside of Slick?

Thanks,
Evan

Sandra

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 754
  • Hero Points: 35
Re: Adaptive formatting not completely disabled?
« Reply #6 on: June 09, 2008, 07:28:39 pm »
I just checked the hotfix, and it does have the fix I mentioned.  The problem was related to updating source control from within SlickEdit.

So you're updating the file while it's also open in SlickEdit and then the file is being reloaded automatically (or after a prompt)?  That might be an area for potential screwiness to happen.  I'll have to do a little investigating.

evanratt

  • Senior Community Member
  • Posts: 300
  • Hero Points: 23
Re: Adaptive formatting not completely disabled?
« Reply #7 on: June 09, 2008, 07:45:44 pm »
Yep, that's my scenario. I'm modifying the file outside of SlickEdit and when I come back in, it prompts to reload the file. After I confirm the reloading, when I first try to type, Adaptive Formatting kicks in.

Thanks for looking into it,
Evan

chrisant

  • Senior Community Member
  • Posts: 1413
  • Hero Points: 131
Re: Adaptive formatting not completely disabled?
« Reply #8 on: June 09, 2008, 07:57:50 pm »
The change was accidentally reverted for a few days, and then it was added back again.  Try downloading hotfixes again, perhaps you didn't actually have the very latest?  Don't know.

Sandra

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 754
  • Hero Points: 35
Re: Adaptive formatting not completely disabled?
« Reply #9 on: June 09, 2008, 09:17:26 pm »
I've been unable to reproduce this so far.  If you don't mind, I'd like you to try a couple of things to see if we can narrow this down.

I've attached a very simple batch macro.  Save it to your SlickEdit macros directory (INSTALLDIR \ macros).  If you could run it before and after you update and reload the file, that would be excellent.  All it does is pop up a message that you can then report back here.  Your steps would be:

1.  Open a file fresh (one that will change if you run an update from source control).
2.  Run the batch macro by typing "adaptiveTest" on the command line.  It should tell you that the flags = -1.
3.  Update file from source control.
4.  Switch control back to SlickEdit and answer "Yes" to reload the file.
5.  Run the batch macro again.

If you could tell me what the message box says each time you run the macro, that would be most helpful.

evanratt

  • Senior Community Member
  • Posts: 300
  • Hero Points: 23
Re: Adaptive formatting not completely disabled?
« Reply #10 on: June 23, 2008, 11:39:38 pm »
Hey Sandra,
So I have not had a chance to really give your macro a test yet, but I did notice something when I installed 13.0.1. Unfortunately, my settings did not get converted when I upgraded, so I went through the options and set everything up again, including disabling Adaptive Formatting and all of its sub-options. I noticed, however, that the Adaptive Formatting option at the bottom of the Document menu in a C++ file was still checked. Could that have something to do with this?

-Evan

Sandra

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 754
  • Hero Points: 35
Re: Adaptive formatting not completely disabled?
« Reply #11 on: June 24, 2008, 01:42:07 pm »
So even after you turned off Adaptive Formatting in the options and applied everything, it still read as ON in the Document menu?  That check uses the exact same function as the main checkbox in the options dialog.  I'm pretty well flummoxed at this point.  Are you still getting the AF dialogs?  What happens after you turn the check off?

evanratt

  • Senior Community Member
  • Posts: 300
  • Hero Points: 23
Re: Adaptive formatting not completely disabled?
« Reply #12 on: July 21, 2008, 05:28:20 pm »
Well, it's been a while, and I'm still having this problem  :(  Any time I've tried running your macro, it says the flags are -1, but I haven't really been able to reliably reproduce the issue yet, so I don't know how meaningful that is. It happens very intermittently, but I really would like Adaptive Formatting to really be disabled... any more ideas?

Thanks,
Evan

chrisant

  • Senior Community Member
  • Posts: 1413
  • Hero Points: 131
Re: Adaptive formatting not completely disabled?
« Reply #13 on: July 21, 2008, 06:09:51 pm »
I was looking through adaptiveformatting.e, and as far as I can tell it looks like AF gets disabled by setting p_adaptive_formatting_flags = -1 and setting other stuff to the language defaults.

I looked for references to p_adaptive_formatting_flags, and found that both save_as and name can set p_adaptive_formatting_flags = 0.  I wonder if they might be effectively accidentally re-enabling AF?

Sandra

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 754
  • Hero Points: 35
Re: Adaptive formatting not completely disabled?
« Reply #14 on: July 21, 2008, 07:10:25 pm »
chrisant, I remember looking at those lines, but I dismissed them as being non-problematic because _SetEditorLanguage is called immediately afterwards, which will set the p_adaptive_formatting_flags to their proper value.  But since _SetEditorLanguage resets the flags, I'm not sure why those lines are even there at all.

Evan, would you mind removing those lines to see if that has any effect on the problem?  Do a fp on save_as and name and comment out any lines that say
Code: [Select]
p_adaptive_formatting_flags = 0;
There should be one line to change in name and two lines to change in save_as.  Load the files up and see what happens.  Let me know if the problem persists or if it magically goes away.

Thanks for the suggestion, chrisant!