andreikop / enki

A text editor for programmers
http://enki-editor.org
GNU General Public License v2.0
161 stars 38 forks source link

Block comment #193

Closed yajo closed 8 years ago

yajo commented 10 years ago

Please add a menu item and shortcut to (un)comment lines.

bjones1 commented 10 years ago

I agree; this would be a helpful feature.

dglent commented 8 years ago

This feature should be implemented in 15.11.0 or later ?

andreikop commented 8 years ago

I've done basic implementation which supports # and // for the most popular languages. Guys, could you test and give some feedback?

andreikop commented 8 years ago

I use and like it. Closing

bjones1 commented 8 years ago

Aargh. I thought I'd posted on this, and even had a nice example of a fix, but must have not clicked the comment button. I'll re-create.

bjones1 commented 8 years ago

When I hilight a block of text to comment out:

image

then press Ctrl+U, I expect only the hilighted lines to be commented out.

image

However, I see that an extra line at the end was commented out, the hilight on the first line was moved to only include the \n at the end of the line, and the hilight extended on the line line to include the entire line. I'd expect similar behavior to pressing Tab:

image

Except, of course, that comment characters are inserted instead of spaces.

bjones1 commented 8 years ago

Another problem: if I open an unsupported file type (.s -- assembly, in my case), Ctrl-U applies Python-style commenting. This should be disabled for unsupported languages. Before:

image

After:

image

andreikop commented 8 years ago

@bjones1, check master now

bjones1 commented 8 years ago

The first problem looks much better. I still see the second case (in a non-Python or C file, Ctrl-U adds the wrong style of comment).

bjones1 commented 8 years ago

Another bug, or perhaps a question: what should Ctrl-U do with mixed comments? My assumption is that it would comment them, uncommenting only it there are already comments everywhere.

I have this: image

I'd like to comment it out, so I press Ctrl-U. But it's partially uncommented instead: image

andreikop commented 8 years ago

Now I judge by first line. But all lines are commented seems good predicate

dglent commented 8 years ago

I installed the latest git version and i cannot use this feature with Ctrl+U, what is the right usage ?

andreikop commented 8 years ago

Just press Ctrl+U. Which language are you coding? Post a sample here

dglent commented 8 years ago

Yes it works in python files I have tried in a rpm spec file to commented the lines