Author Topic: Comment/Uncomment change in 12.0.2  (Read 8725 times)

asipe

  • Senior Community Member
  • Posts: 113
  • Hero Points: 4
Comment/Uncomment change in 12.0.2
« on: July 10, 2007, 12:27:56 pm »
Comment and Uncomment don't seem to work correctly in 12.0.2.

If I have a section of code and comment it using SE and then uncomment it using SE the indentation is all wrong.   This didn't use to be the case.

I've seen this behavior in C# and in Ruby code.

Is there some setting I'm missing to fix this behavior?

--andy

hs2

  • Senior Community Member
  • Posts: 2725
  • Hero Points: 281
Re: Comment/Uncomment change in 12.0.2
« Reply #1 on: July 10, 2007, 01:57:08 pm »
There is one more comment problem, but it's rather comment wrap related.
comment settings:
Comment wrap ON, Block wrap ON, Line wrap ON
Line comment: '// ' - at level of indent
1.
Code: [Select]
// line comment<cursor here -> ENTER>
/* other comment */
sometimes results in:
Code: [Select]
// line comment<cursor here -> ENTER>
/ <cursor here>
/* other comment */
I didn't recognize the reason why the line comment sometimes fails and sometimes not ???
(only tried c and slick-c mode)

HS2

David_O

  • Senior Community Member
  • Posts: 152
  • Hero Points: 8
Re: Comment/Uncomment change in 12.0.2
« Reply #2 on: July 10, 2007, 02:23:52 pm »
Thanks for finding that.  I was able to reproduce that, so we'll try to get a hotfix for that soon.

hs2

  • Senior Community Member
  • Posts: 2725
  • Hero Points: 281
Re: Comment/Uncomment change in 12.0.2
« Reply #3 on: July 10, 2007, 02:30:13 pm »
Thanks a lot David - in case you're referring to 'my' problem ;)
HS2

Sandra

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 754
  • Hero Points: 35
Re: Comment/Uncomment change in 12.0.2
« Reply #4 on: July 10, 2007, 02:35:39 pm »
Comment and Uncomment don't seem to work correctly in 12.0.2.

If I have a section of code and comment it using SE and then uncomment it using SE the indentation is all wrong.   This didn't use to be the case.

I've seen this behavior in C# and in Ruby code.

Is there some setting I'm missing to fix this behavior?

--andy

There aren't any mystery settings associated with this one.  Could you provide an example of the behavior that you're seeing?  What are your line comment settings (level of indent, left margin)?

asipe

  • Senior Community Member
  • Posts: 113
  • Hero Points: 4
Re: Comment/Uncomment change in 12.0.2
« Reply #5 on: July 10, 2007, 04:26:16 pm »
Sandra:

Here is a simple example:  ruby code

Code: [Select]
class SomeClass
  def this_is_a_method
    do_something
  end
end

Select the method and comment it using SE and you get:

Code: [Select]
class SomeClass
# def this_is_a_method
#   do_something
# end
end

Select the commented lines and uncomment it using SE and you get:

Code: [Select]
class SomeClass
 def this_is_a_method
   do_something
 end
end

Notice how the def is only indented a single space vs the original 2 spaces. 

Here are some of my settings:
  * Indent Style:  Syntax indent, 2
  * Comment Line:  Location, At left margin

This example is ruby, but the same exact thing happens in c#.

Hope that helps.

--andy


asipe

  • Senior Community Member
  • Posts: 113
  • Hero Points: 4
Re: Comment/Uncomment change in 12.0.2
« Reply #6 on: July 10, 2007, 04:28:02 pm »
Note that if I change the location to 'At level of indent', the formatting works as expected.

--andy

Sandra

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 754
  • Hero Points: 35
Re: Comment/Uncomment change in 12.0.2
« Reply #7 on: July 10, 2007, 04:56:37 pm »
Try putting this file in your macros directory and loading it (you may want to back up your old one first).  See if that takes care of the problem.

dmw

  • Senior Community Member
  • Posts: 145
  • Hero Points: 15
Re: Comment/Uncomment change in 12.0.2
« Reply #8 on: July 12, 2007, 02:57:10 pm »
That seems to have fixed the problem for me in Python mode.

ch

  • Community Member
  • Posts: 13
  • Hero Points: -1
Re: Comment/Uncomment change in 12.0.2
« Reply #9 on: July 13, 2007, 02:41:43 pm »
I have all commenting set to "At left margin". I'm see incorrect indenting and unindenting in all source files I tested (bas, c, cpp, cs, pas, and rb).

Sandra

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 754
  • Hero Points: 35
Re: Comment/Uncomment change in 12.0.2
« Reply #10 on: July 13, 2007, 03:02:49 pm »
Are you seeing these problems even after loading the updated box.e from the previous post?  I just tried sample files with all of those extensions and did not see any problems, with the exception of Pascal (which is having a different problem).

If you have loaded the new box.e, could you provide an example of the behavior that you're seeing? 

ch

  • Community Member
  • Posts: 13
  • Hero Points: -1
Re: Comment/Uncomment change in 12.0.2
« Reply #11 on: July 13, 2007, 03:24:25 pm »
Are you seeing these problems even after loading the updated box.e from the previous post?

Yes.

The following three ruby code samples demonstrate the issue.

Code: [Select]
def sample()
    return "sample return value"
end
puts sample()


#def sample()
#    return "sample return value"
#end
#puts sample()


 def sample()
     return "sample return value"
 end
 puts sample()

Notice the extra space left in column one after the comments are removed.

Sandra

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 754
  • Hero Points: 35
Re: Comment/Uncomment change in 12.0.2
« Reply #12 on: July 17, 2007, 08:37:25 pm »
Give this hotfix a try and see if it helps.



Edit - the posted hotfix was added to cumulative hotfix, which can be found at www.slickedit.com/hotfix -> SlickEdit 2007 (v12x).
« Last Edit: July 24, 2007, 08:38:44 pm by Sandra »

lambertia

  • Senior Community Member
  • Posts: 382
  • Hero Points: 14
  • I have nothing sufficiently witty to say.
Re: Comment/Uncomment change in 12.0.2
« Reply #13 on: July 17, 2007, 11:01:31 pm »
Hi.

And while you're looking at comments, has anyone had a look at this yet? In renders the unsurround block functionality useless. Which is a shame:

http://community.slickedit.com/index.php?topic=1656.msg6938#msg6938

Cheers,
--
Greg.

Ivan N. Zlatev

  • Community Member
  • Posts: 87
  • Hero Points: 5
Re: Comment/Uncomment change in 12.0.2
« Reply #14 on: July 24, 2007, 01:40:59 pm »
Give this hotfix a try and see if it helps.

Sandra, this fixes the uncomment for me in C#, with the exception for Comment Block which indents the commented block with an additional space in the beginning. E.g

Code: [Select]
private void PopulateToolbox (IToolboxService toolbox)
{
toolbox.AddToolboxItem (new ToolboxItem (typeof (MyButton)));
toolbox.AddToolboxItem (new ToolboxItem (typeof (MyPanel)));
}

Code: [Select]
/*
 private void PopulateToolbox (IToolboxService toolbox)
 {
     toolbox.AddToolboxItem (new ToolboxItem (typeof (MyButton)));
     toolbox.AddToolboxItem (new ToolboxItem (typeof (MyPanel)));
 }
*/