Community
Participate
Working Groups
I'm used to comment/uncomment lines as in Kwrite or Kate in KDE or even in Matlab. That is, in several "layers". For example, fortran code can look like this: print *,hello !print *,hellu print *,hello !!print *,hella !!!!print *,helli If I select all the lines and uncomment them, it should look like this: print *,hello print *,hellu print *,hello !print *,hella !!!print *,helli From here, commenting lines should simply put a single ! in front of each line again. Instead, because only the so-called "Photran Block Comment" function is available, which is just a toggling comment command, I end up with this: !print *,hello print *,hellu !print *,hello !print *,hella !!!print *,helli Using the same Photran Block comment on all lines again results in this: print *,hello !print *,hellu print *,hello print *,hella !!print *,helli Using it again subsequently ends up cycling between !print *,hello print *,hellu !print *,hello !print *,hella !print *,helli and print *,hello !print *,hellu print *,hello print *,hella print *,helli It ends up eating all my layers of ! I find toggling comments in eclipse extremely user-UNfriendly! I see a lot of comment/uncomment commands in "keys" in preferences, but only the bindings to Photran Block Comment has an effect. Comment/Uncommenting as in Kwrite, Kate or Matlab is very useful when quickly disabling parts of code, but still keeping those parts ready to reactivate. For example in trial and error coding (which is very useful when coding in Fortran). I use the Photran editor the most and the comment/uncomment functions work fine in C++ editor. Would it be possible to integrate these functions in Photran editor too? I found a workaround for now: I have to shift code left or right first before toggling comments. It is extremely annoying because shifting code is very slow. That is, it takes 4 seconds to shift 1 indentation distance. Somehow, shifting codes seems to suck up memory. This is not good when trying to code fast! In addition, I have to use two series of shortcuts, which I'd rather avoid. Thanks in advance, Damien
Created attachment 227948 [details] proposed patch I confirm that: (a) I wrote 100% of the code without incorporating content from elsewhere or relying on the intellectual property of others (b) I have the right to contribute the code to Eclipse (c) I have included the EPL license header in all source files.
Patch uses only the first selected line to determine whether the lines in the block selection will have a comment added or removed (similar to block comment toggle works for Java editor in eclipse) Additionally, maintains the selection region from before the comment toggle, instead of changing the selection to be the whole 1st and last lines.
This is a small patch, so I was able to commit it without a full IP review. Thanks again, Lou. Applied in master for Kepler GA.