• Login
Community
  • Login

Let Comment Flags Keep Aligned

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
2 Posts 2 Posters 217 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L
    linzhongzi
    last edited by linzhongzi Aug 29, 2023, 1:38 AM Aug 29, 2023, 1:37 AM

    c71ff412-4d69-4d97-801b-8a43426a28de-image.png
    When I press ctrl+q to comments the code lines, the comments flag “rem” not to be placed at the front of the line. Can you make it keeping aligned.
    Just as follow:
    f42bbabd-d655-4337-9a7b-95a97ef8f278-image.png

    1 Reply Last reply Reply Quote 0
    • T
      TBugReporter
      last edited by TBugReporter Aug 29, 2023, 8:23 AM Aug 29, 2023, 8:11 AM

      Here’s what I do for this. Add this to the <Macros> section of your shortcuts.xml file:

              <Macro name="Col. 1 Remark" Ctrl="yes" Alt="yes" Shift="no" Key="75">
                  <Action type="0" message="2349" wParam="0" lParam="0" sParam="" />
                  <Action type="1" message="2170" wParam="0" lParam="0" sParam="REM " />
              </Macro>
      

      Key 75 is the letter K, so this adds a Ctrl-Alt-K keystroke to your configuration (you said Ctrl-Q, but my solution isn’t a toggle like that keystroke; if you want Ctrl-Alt-Q, change 75 to 81); message 2349 says to go to the beginning of the line (unconditionally, i.e. not just the beginning of the text on the line); and message 2170 says to type the given text - REM and a space (the forum won’t let me show the space in red here). If you edit other types of files this way, you can change to the comment string for whatever language you’re using, and assign a different key for that one.

      1 Reply Last reply Reply Quote 1
      1 out of 2
      • First post
        1/2
        Last post
      The Community of users of the Notepad++ text editor.
      Powered by NodeBB | Contributors