Author Topic: Comment blocks  (Read 9434 times)

Sandra

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 754
  • Hero Points: 36
Re: Comment blocks
« Reply #15 on: February 23, 2012, 08:32:20 PM »
With one of your files open, what language is listed under Document > Select Mode (<language>)?

If you opened and closed a file before assigning its extension to ANSI-C, when you open it again, it will remember the last extension it had, rather than the new mode assigned to its extension.  You may need to set the mode manually for these files, by going to Document > Select Mode.
« Last Edit: February 23, 2012, 09:14:36 PM by Sandra »

SeeCwriter

  • Senior Community Member
  • Posts: 146
  • Hero Points: 1
Re: Comment blocks
« Reply #16 on: February 23, 2012, 08:54:29 PM »
The file extension has been assigned to ANSI-C for over a week now. This is not
something I just did today. And the extension is set for ANSI-C. However,
changing the C/C++ comment section affects how my comments are presented.
Changing the comment block appearance in ANSI-C has no effect on the comment
block. Only changing it in the C/C++ section has an effect.

Sandra

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 754
  • Hero Points: 36
Re: Comment blocks
« Reply #17 on: February 23, 2012, 09:27:18 PM »
The situation I described could happen no matter how long ago you changed the extension mapping.  If the files had been opened and closed before you made the change, they could have been pointing to C/C++ the whole time.  You could have opened and closed the files all week long and they would still think they were C/C++.  The handling of the languages is similar, so you might not have noticed it until you tried to change the options. 

In terms of individual files, you can determine which language they are using by looking under the Document menu, at the Select Mode item.  It will display the language for the current file in parenthesis.

What extension is it?


SeeCwriter

  • Senior Community Member
  • Posts: 146
  • Hero Points: 1
Re: Comment blocks
« Reply #18 on: February 23, 2012, 09:51:00 PM »
Interesting. The Select Mode item says "C/C++". And yet, the File Extension
Manager indicates that my file extension associated with ANSI-C. So the File
Extension Manager doesn't do anything?

Sandra

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 754
  • Hero Points: 36
Re: Comment blocks
« Reply #19 on: February 23, 2012, 09:53:35 PM »
What happens when you open a new file with this extension?  On the SlickEdit command line, type "e foo.<yourExtension>".  Then check the mode on the Document menu.

SeeCwriter

  • Senior Community Member
  • Posts: 146
  • Hero Points: 1
Re: Comment blocks
« Reply #20 on: February 23, 2012, 09:57:17 PM »
For the new file Select Mode indicates ANSI-C.

Sandra

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 754
  • Hero Points: 36
Re: Comment blocks
« Reply #21 on: February 23, 2012, 10:05:26 PM »
Okay, it's likely that the other files saved their language modes before you pointed the extension to ANSI-C.  There are a few ways to handle this:

1.  Set the language for each file individually as you use them (Document > Select Mode... > ANSI-C).  If there aren't that many files, this shouldn't be too bad.
2.  Delete the configuration file that saves this information.  You can find this file in your configuration directory.  It is named "perfile.xml."  You will lose other saved info about these files, like whether you had soft wrap on and the last cursor position.  If that info is not important to you, deleting the file may be the easiest route.
3.  You could remove only the language information from perfile.xml.  Open that file up and do a search for the "LangId" attributes.  Then just remove them.  You should be able to use SlickEdit's Search/Replace features to do this.

I know this is a pain, and you're not the first user to run into it.  We've improved the way we save/restore language modes, but those changes won't be released until v17.

SeeCwriter

  • Senior Community Member
  • Posts: 146
  • Hero Points: 1
Re: Comment blocks
« Reply #22 on: February 23, 2012, 10:13:15 PM »
A pain is right!