GithubHelp home page GithubHelp logo

Double <CR> in input mode about supertab HOT 7 CLOSED

ervandew avatar ervandew commented on August 26, 2024
Double in input mode

from supertab.

Comments (7)

ervandew avatar ervandew commented on August 26, 2024

The quickest solution for you would be to add the following to your vimrc:

let g:SuperTabCrMapping = 0

When I get a chance I'll see if I can get supertab to properly handle your mapping, but unfortunately vim doesn't make it easy.

from supertab.

achalddave avatar achalddave commented on August 26, 2024

Cool, thanks. Out of curiosity, what is the issue? I tried understanding the code there but from what I can tell you send a <cr> only if my <cr> isn't mapped to something that includes <cr>, and the part that checks for is let cr = (map =~? '\(^\|[^)]\)<cr>'). Essentially, I'm interested in vimscript and was wondering what's different about my mapping that makes it difficult to work around.

from supertab.

ervandew avatar ervandew commented on August 26, 2024

Vim unfortunately makes it very difficult to chain mappings together, so supertab attempts to handle chaining it's mapping against an existing mapping and it tries to determine when it can issue it's own <cr> without duplicating a <cr> from the other mapping. Usually the presence of a <cr> in the original is part of a <c-r>=SomeFunction<cr> mapping where the <cr> is simply telling vim that the <c-r>= portion is completed, not a literal carriage return. In your case the <cr> is a literal carriage return, so that's throwing it's code off a bit.

It looks like I'll have to update it to determine the context of the <cr> in the existing mapping or mappings if multiple are already chained together, which happens.

from supertab.

mtikekar avatar mtikekar commented on August 26, 2024

I have a potentially related problem with abbreviations. When I do :iabbrev a a<cr>b, it inserts two b's. let g:SuperTabCrMapping = 0 fixes it.

from supertab.

ervandew avatar ervandew commented on August 26, 2024

@mehultikekar
For your issue I've just updated supertab to not map to <cr> if it detects an iabbrev mapping with a <cr> in it.

6f9b1f1

from supertab.

 avatar commented on August 26, 2024

I get the double newline when the only plugins are supertab and the new version of tpope's endwise plugin*. Not sure which plugin is the cause since both had updates in the same timeframe. I'll also file an issue in endwise's repo.

from supertab.

ervandew avatar ervandew commented on August 26, 2024

Seems to have been resolved by tpope/vim-endwise#55

from supertab.

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.