<?xml version="1.0" encoding="utf-8"?>
<page xmlns="http://projectmallard.org/1.0/" type="topic" id="gedit-plugin-code-comment" lang="pt_BR">

  <info>
    <link type="guide" xref="gedit-plugin-guide#gedit-default-plugins"/>
    <desc>Comment-out or uncomment lines of code.</desc>
  <credit type="translator copyright"><name>Wagner Luís de Araújo Menezes Macêdo</name><email>wagnerluis1982@gmail.com</email><years>2007</years></credit><credit type="translator copyright"><name>Pedro Vaz de Mello de Medeiros</name><email>pedrovmm@gmail.com</email><years>2007</years></credit><credit type="translator copyright"><name>Leonardo Ferreira Fontenelle</name><email>leonardof@gnome.org</email><years>2007, 2008</years></credit><credit type="translator copyright"><name>Vladimir Melo</name><email>vmelo@gnome.org</email><years>2008</years></credit><credit type="translator copyright"><name>Fabricio Godoy</name><email>skarllot@gmail.com</email><years>2008</years></credit><credit type="translator copyright"><name>Krix Apolinário</name><email>krixapolinario@gmail.com</email><years>2009</years></credit><credit type="translator copyright"><name>José Carlos Menezes</name><email>jcmenezes.91@gmail.com</email><years>2013</years></credit><credit type="translator copyright"><name>Enrico Nicoletto</name><email>hiko@duck.com</email><years>2013, 2014, 2022</years></credit><credit type="translator copyright"><name>Rafael Fontenelle</name><email>rafaelff@gnome.org</email><years>2013-2020</years></credit><credit type="translator copyright"><name>Bruno Lopes</name><email>brunolopesdsilv@gmail.com</email><years>2021.</years></credit><credit type="translator copyright"><name>Giovanni dos S.A.L Rodrigues</name><email>giovannilombone.io@gmail.com</email><years>2024</years></credit></info>

  <title>Code Comment</title>

  <p>
    The purpose of the <app>Code Comment</app> plugin is to disable or re-enable
    a portion of code. It inserts or removes the characters used for comments,
    depending on the language or syntax of the file.
  </p>

  <p>
    First select some lines of code (or lines of text), then trigger the desired
    action (comment or uncomment) via one of these methods:
  </p>
  <list>
    <item><p>
        With the right-click menu in the main text area.
    </p></item>
    <item><p>
        With keyboard shortcuts: <keyseq><key>Ctrl</key><key>M</key></keyseq>
        for the comment action, and
        <keyseq><key>Ctrl</key><key>Shift</key><key>M</key></keyseq> for the
        uncomment action.
    </p></item>
  </list>

  <section>
    <title>Troubleshooting</title>
    <p>If it doesn't work:</p>
    <list>
      <item><p>
        Make sure that the plugin is enabled by going to the
        <gui>Preferences</gui> dialog.
      </p></item>
      <item><p>
        Check that the
        <link xref="gedit-syntax-highlighting">highlight mode</link>
        (the syntax) for the document is correctly set and is not “Plain Text”.
        For plain text documents, the code comment plugin doesn't know what
        characters to insert or remove.
      </p></item>
      <item><p>
        If it still doesn't work as intended, a more advanced technique is to
        look at the
        <link href="https://gedit-text-editor.org/developer-docs/libgedit-gtksourceview-300/lang-reference.html">language definition</link>
        files. From these files, the code comment plugin uses the
        <code>line-comment-start</code>, <code>block-comment-start</code> and
        <code>block-comment-end</code> metadata.
      </p></item>
      <!--
      <item><p>
        You can also launch <app>gedit</app> from a terminal to see if it prints
        relevant warning messages.
      </p></item>
      -->
    </list>
  </section>
</page>
