New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

comment/uncomment with different select(highlight) direction #1419

Closed
gbuntu127 opened this Issue Sep 18, 2016 · 8 comments

Comments

Projects
None yet
3 participants
@gbuntu127

gbuntu127 commented Sep 18, 2016

Codelite version 9.2.2
Kernel: 4.4.0-34-generic x86_64 (64 bit) Desktop: Cinnamon 3.0.7, Distro: Linux Mint 18 Sarah

Scenario:
A.this is c++ code line one
this is c++ code line two.B

  1. Select both lines use mouse, select "Edit-Comment-Comment Line". Result: both lines will be commented out.
  2. Use mouse cursor to select both lines. Specifically, click from letter A, hold and drag mouse to highlight to letter B. Select "Edit-Comment-Comment Line". Result: both lines will be added one more "//" in front. Expected: the two lines of code are un-commented.

However, if in step 2 we do "click from letter B, hold and drag highlight to letter A" (different highlight direction). Select "Edit-Comment-Comment Line". Result: both lines are correctly un-commented.

This actually happens to single line of code as well.

@gbuntu127 gbuntu127 changed the title from comment/uncomment mutiple lines to comment/uncomment with different select(highlight) direction Sep 18, 2016

@eranif

This comment has been minimized.

Show comment
Hide comment
@eranif

eranif Sep 19, 2016

Owner

I am unable to reproduce this (for me, no matter the highlight direction, it always "toggles" the selection)
Can you upload a sample file? maybe there are some tabs/spaces before the code section that causes unpredictable behavior?

Owner

eranif commented Sep 19, 2016

I am unable to reproduce this (for me, no matter the highlight direction, it always "toggles" the selection)
Can you upload a sample file? maybe there are some tabs/spaces before the code section that causes unpredictable behavior?

@gbuntu127

This comment has been minimized.

Show comment
Hide comment
@gbuntu127

gbuntu127 Sep 19, 2016

This happens even to the simplest file. It has nothing to do with the tabs/spaces as it happens even when no space/tabs before the characters. Note that at Step 2 above for "Use mouse cursor to select both lines", I meant to select everything including the added "//" from step 1.

I am not sure what your expected behavior for selecting lines of code with leading "//". For me, I expect the leading "//" being removed. In fact, when I highlighted from //A to B (as shown below), it indeed toggles the comment. Highlight from the other direction only adds more leading comment "//" for both lines.

//A.this is c++ code line one
//this is c++ code line two.B

test.cpp.txt

gbuntu127 commented Sep 19, 2016

This happens even to the simplest file. It has nothing to do with the tabs/spaces as it happens even when no space/tabs before the characters. Note that at Step 2 above for "Use mouse cursor to select both lines", I meant to select everything including the added "//" from step 1.

I am not sure what your expected behavior for selecting lines of code with leading "//". For me, I expect the leading "//" being removed. In fact, when I highlighted from //A to B (as shown below), it indeed toggles the comment. Highlight from the other direction only adds more leading comment "//" for both lines.

//A.this is c++ code line one
//this is c++ code line two.B

test.cpp.txt

@eranif

This comment has been minimized.

Show comment
Hide comment
@eranif

eranif Sep 21, 2016

Owner

Still, works...
See this short mp4 video I captured:

http://codelite.org/tmp/toggle-comment.mp4

NOTE:
I am using Ctrl-/ keyboard shortcut to toggle the comment

Owner

eranif commented Sep 21, 2016

Still, works...
See this short mp4 video I captured:

http://codelite.org/tmp/toggle-comment.mp4

NOTE:
I am using Ctrl-/ keyboard shortcut to toggle the comment

@gbuntu127

This comment has been minimized.

Show comment
Hide comment
@gbuntu127

gbuntu127 Sep 21, 2016

It still does not work for me. I did the same thing as you did but having different behaviors. See my captured video:

toggle-comment2

I guess it is just system related bug.

gbuntu127 commented Sep 21, 2016

It still does not work for me. I did the same thing as you did but having different behaviors. See my captured video:

toggle-comment2

I guess it is just system related bug.

@gbuntu127

This comment has been minimized.

Show comment
Hide comment
@gbuntu127

gbuntu127 Sep 21, 2016

I also tried to use a fresh ~/.codelite folder and it was the same result.

gbuntu127 commented Sep 21, 2016

I also tried to use a fresh ~/.codelite folder and it was the same result.

@eranif

This comment has been minimized.

Show comment
Hide comment
@eranif

eranif Sep 21, 2016

Owner

The only difference is that I am using Windows and you are using Linux, will try on my Linux box

Owner

eranif commented Sep 21, 2016

The only difference is that I am using Windows and you are using Linux, will try on my Linux box

@pattisahusiwa

This comment has been minimized.

Show comment
Hide comment
@pattisahusiwa

pattisahusiwa Sep 23, 2016

Contributor

Still, works...
See this short mp4 video I captured:

Actually, the issue is also shown on your video. you selected 2 lines, but 3 lines have been commented.

Contributor

pattisahusiwa commented Sep 23, 2016

Still, works...
See this short mp4 video I captured:

Actually, the issue is also shown on your video. you selected 2 lines, but 3 lines have been commented.

@gbuntu127

This comment has been minimized.

Show comment
Hide comment
@gbuntu127

gbuntu127 Sep 23, 2016

That was how codelite did it when I highlighted from the line start to the line end.

gbuntu127 commented Sep 23, 2016

That was how codelite did it when I highlighted from the line start to the line end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment