Feature Request : shortcut for un/comment selection

Bug #501337 reported by Jonathan Gibert
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Scribes
Fix Released
Undecided
Unassigned

Bug Description

A simple shortcut to toggle comment character on selection (as ctrl+q in notepad++)

Revision history for this message
Mystilleef (mystilleef) wrote :

alt+c comment and uncomments lines. It's only been implemented for a few languages (Python, Ruby, Perl, Bash, etc).

Revision history for this message
Jonathan Gibert (jokot3) wrote :

My bad, I wasn't reading the good version of the help file (not mentioned on 0.3 help file :/)

Revision history for this message
Mystilleef (mystilleef) wrote :

It's not your fault. It's mine. :-) The user guide has not been updated. It will before 0.4 is released.

Revision history for this message
Matěj Cepl (mcepl) wrote :

How difficult is to add support for another language (Javascript)? Is it simple to do both one line (//) and multiline (/* ... */) style of comments?

Revision history for this message
Mystilleef (mystilleef) wrote :

I'll try to implement commenting for Javascript this weekend. Everything is simple to do. Doing it right is what's hard. :-)

Revision history for this message
Matěj Cepl (mcepl) wrote :

thanks a lot

Revision history for this message
Mystilleef (mystilleef) wrote :

Matej,

I just pushed a somewhat untested implementation of JavaScript commenting to the branch. It's in build 565. Still needs a lot of work and polish. But it's the best I could do by the weekend. :-) Please test.

Usage:

1) alt+c (un)comments single lines with "//"
2) Selecting multiple lines and pressing alt+c will (un)comment them with "/* */"
3) If cursor is inside a multiline comment, "/* */", alt+c will try to uncomment it.

There may be many corner cases that I have not handled correctly. Again I haven't tested extensively. So your feedback is appreciated.

Revision history for this message
Matěj Cepl (mcepl) wrote :

Complete!
johanka:build$ ed
ERROR:dbus.proxies:Introspect error on :1.1051:/net/sourceforge/Scribes: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

Traceback (most recent call last):
  File "/home/matej/.bin/ed", line 11, in <module>
    main()
  File "/usr/lib/python2.6/site-packages/SCRIBES/Main.py", line 7, in main
    __open()
  File "/usr/lib/python2.6/site-packages/SCRIBES/Main.py", line 20, in __open
    __open_via_dbus(uris)
  File "/usr/lib/python2.6/site-packages/SCRIBES/Main.py", line 31, in __open_via_dbus
    dbus_service.open_files(uris, dbus_interface=scribes_dbus_service)
  File "/usr/lib/python2.6/site-packages/dbus/proxies.py", line 68, in __call__
    return self._proxy_method(*args, **keywords)
  File "/usr/lib/python2.6/site-packages/dbus/proxies.py", line 140, in __call__
    **keywords)
  File "/usr/lib/python2.6/site-packages/dbus/connection.py", line 630, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
johanka:build$

Revision history for this message
Matěj Cepl (mcepl) wrote :

Sorry, forget about the last comment ... scribes apparently is not happy when you try to run new version and the old version is still running. Seems to work (just a very little testing)

Mystilleef (mystilleef)
Changed in scribes:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.