Author Topic: C++ files not recognozed as a C++ file after a file diff?  (Read 4158 times)

tlhumm

  • Community Member
  • Posts: 28
  • Hero Points: 1
C++ files not recognozed as a C++ file after a file diff?
« on: November 23, 2016, 10:28:04 PM »
I used the file diff tool  on two .cc files. Now slick edit treats these two files as plain text files. No formatting, indenting, colors etc. I even deleted the files and rechecked them out fresh, restarted slick edit to no avail. All other files are OK, just the two files I diffed. Short of deleting the project and starting fresh,  would anybody know what happened and how to recover from this?

davehohl

  • Senior Community Member
  • Posts: 271
  • Hero Points: 27
Re: C++ files not recognozed as a C++ file after a file diff?
« Reply #1 on: November 23, 2016, 10:34:00 PM »
Make sure the file is open in the currently active buffer and select Document>Select Mode from the menu bar. You can then change the document type.

tlhumm

  • Community Member
  • Posts: 28
  • Hero Points: 1
Re: C++ files not recognozed as a C++ file after a file diff?
« Reply #2 on: November 23, 2016, 10:38:00 PM »
Thank you that fixed it. That was quit annoying. Why would the file diff tool do this? Is there a way to prevent this from happening in the future?

davehohl

  • Senior Community Member
  • Posts: 271
  • Hero Points: 27
Re: C++ files not recognozed as a C++ file after a file diff?
« Reply #3 on: November 24, 2016, 12:03:11 AM »
I have had the file type change seemingly randomly in some cases. Never seen it happen while doing a diff, though. The SlickEdit team will need to answer that one.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2899
  • Hero Points: 153
Re: C++ files not recognozed as a C++ file after a file diff?
« Reply #4 on: November 28, 2016, 02:16:39 PM »
DIFFzilla doesn't do this on purpose.  I'm not aware of any problem areas where we're doing it accidentally.

Are you using v21?

Were you comparing two files, or comparing individual files with version control?

Can you reproduce the issue?

tlhumm

  • Community Member
  • Posts: 28
  • Hero Points: 1
Re: C++ files not recognozed as a C++ file after a file diff?
« Reply #5 on: November 28, 2016, 05:30:05 PM »
I can understand why DIFFzilla may do this. The problem is that it does not change it back. Which seems like a bug to me.

tlhumm

  • Community Member
  • Posts: 28
  • Hero Points: 1
Re: C++ files not recognozed as a C++ file after a file diff?
« Reply #6 on: November 28, 2016, 05:49:38 PM »
Yes, it does it every time when comparing two files.

SlickEdit Pro 2015 (v20.0.0.12 64-bit)

Build Date: November 10, 2015
Emulation: GNU Emacs

OS: Windows 7 x64
OS Version: 6.01.7601  Service Pack 1
Memory: 23% Load, 7750MB/32690MB Physical, 9254MB/65378MB Page File, 973MB/8388607MB Virtual
Shell Information: C:\Windows\system32\cmd.exe /q
Screen Size: 1920 x 1080, 1920 x 1080

Project Type: Gnuc
Language: .cc (C/C++)
Encoding: Automatic


Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2899
  • Hero Points: 153
Re: C++ files not recognozed as a C++ file after a file diff?
« Reply #7 on: November 28, 2016, 06:07:33 PM »
It should not do that at all.

I tried GNU Emacs emulation and still was not able to reproduce it.

I tried v20.0.0 (there is a v20.0.2 and hotfixes available as well), and I was still unable to reproduce it.

Is this a new problem?

Does it only happen with .cc files?  I tried .cc files as well.

Is the file already out of C mode when the file is being diffed, or not until after the diff is closed?

Did you have the file open before you diffed it, or does it matter?

tlhumm

  • Community Member
  • Posts: 28
  • Hero Points: 1
Re: C++ files not recognozed as a C++ file after a file diff?
« Reply #8 on: December 02, 2016, 05:31:39 PM »
Thanks for looking into this and I apologize for not responding sooner.
I also just tried to reproduce this and it now doesn't do this.  I thought it may have something to do with the fact that I renamed one file by putting a .orig at the end of the file, so I was comparing foo.cc with foo.cc.orig, although that also seems to work now. So what ever was causing this has seemed to go away, or else I was doing something different that I'm not aware of.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2899
  • Hero Points: 153
Re: C++ files not recognozed as a C++ file after a file diff?
« Reply #9 on: December 02, 2016, 05:34:56 PM »
For this reason, when I do this sort of thing I tend to rename something "orig.file1.cpp". Of course you could change the mode of file1.cpp.orig and it should remember that too.

If you see that problem again, please let me know.

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Re: C++ files not recognozed as a C++ file after a file diff?
« Reply #10 on: December 02, 2016, 09:20:41 PM »
Weren't there a couple of cases during V21 beta where the file mode was being reset to plain text?
I thought there was a case where it did this with diff, but I couldn't find a reference when I searched the forum.


Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2899
  • Hero Points: 153
Re: C++ files not recognozed as a C++ file after a file diff?
« Reply #11 on: December 05, 2016, 02:07:56 PM »
Sounds familiar, but I don't remember it being because of the diff specifically.

Dennis

  • Senior Community Member
  • Posts: 3965
  • Hero Points: 517
Re: C++ files not recognozed as a C++ file after a file diff?
« Reply #12 on: December 20, 2016, 05:14:52 PM »
FYI.  We are adding support for recognizing the language mode of files with "backup" file extensions for the next release.  So, in your case, where you had file1.cpp.orig, we will recognize that ".orig" is can be discarded and will determine the file mode from ".cpp".  The extensions that this will work for will be configurable in the Languages > File Extension Manager dialog.