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

tlhumm

  • Junior Community Member
  • Posts: 8
  • Hero Points: 0
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: 269
  • Hero Points: 22
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

  • Junior Community Member
  • Posts: 8
  • Hero Points: 0
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: 269
  • Hero Points: 22
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: 2068
  • Hero Points: 100
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

  • Junior Community Member
  • Posts: 8
  • Hero Points: 0
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

  • Junior Community Member
  • Posts: 8
  • Hero Points: 0
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: 2068
  • Hero Points: 100
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

  • Junior Community Member
  • Posts: 8
  • Hero Points: 0
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: 2068
  • Hero Points: 100
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: 1499
  • Hero Points: 125
  • 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: 2068
  • Hero Points: 100
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

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2354
  • Hero Points: 315
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.