Giter VIP home page Giter VIP logo

Comments (4)

Garonenur avatar Garonenur commented on June 2, 2024

a possible patch:

diff --git a/plugin/NERD_commenter.vim b/plugin/NERD_commenter.vim
index fa6c3c8..e6660ce 100644
--- a/plugin/NERD_commenter.vim
+++ b/plugin/NERD_commenter.vim
@@ -516,12 +516,12 @@ function s:AppendCommentToLine()

     "stick the delimiters down at the end of the line. We have to format the
     "comment with spaces as appropriate
-    execute ":normal! " . insOrApp . (isLineEmpty ? '' : ' ') . left . right
+    execute ":normal! " . insOrApp . (isLineEmpty ? '' : ' ') . left . right . " "

     " if there is a right delimiter then we gotta move the cursor left
     " by the len of the right delimiter so we insert between the delimiters
     if lenRight > 0
-        let leftMoveAmount = lenRight - 1
+        let leftMoveAmount = lenRight
         execute ":normal! " . leftMoveAmount . "h"
     endif
     startinsert

from nerdcommenter.

Garonenur avatar Garonenur commented on June 2, 2024

sorry about the close, I am new to github

from nerdcommenter.

phro avatar phro commented on June 2, 2024
"stick the delimiters down at the end of the line. We have to format the
"comment with spaces as appropriate
execute ":normal! " . insOrApp . (isLineEmpty ? '' : ' ') . left . " " . right 

" if there is a right delimiter then we gotta move the cursor left
" by the len of the right delimiter so we insert between the delimiters
if lenRight > 0
    let leftMoveAmount = lenRight
    execute ":normal! " . leftMoveAmount . "h"
endif
startinsert
call cursor(0, col('.')+1)
endfunction

Not written in `patch' format, sorry, but the space that was appended was (I think) intended to give the user some whitespace between the comment delimiter and the actual comment itself. This patch moves the cursor over so that when you begin typing, the space is to the left of the cursor, not the right (also note this fixes the whitespace after closing delimiter problem).

from nerdcommenter.

alerque avatar alerque commented on June 2, 2024

Fixed in #130.

from nerdcommenter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.