GithubHelp home page GithubHelp logo

Comments (5)

sergeche avatar sergeche commented on June 8, 2024

I guess you’ve used expandAbbreviation command as tab key handler? You should use abbreviation tracker instead as described in README, it contains all the required logic to handle Tab key.

The reason to expand abbreviation if range > 0 is to allow user to select specific text and expand it as abbreviation (in case if abbreviation extraction doesn’t work as expected)

from codemirror6-plugin.

shshaw avatar shshaw commented on June 8, 2024

Hm, I currently have both, which may be part of the problem. I think I had the Tab keymap from the previous version and added abbreviationTracker when that was available.

Screenshot 2023-10-04 at 10 03 43 AM

To clarify: If you use abbreviationTracker, you do not need a separate keymap for expandAbbreviation?

from codemirror6-plugin.

shshaw avatar shshaw commented on June 8, 2024

Okay, I did get this working with just abbreviationTracker. However, I had to set this extension to Prec.high in order for the Tab keymap to run ahead of the indentWithTab keymap

    Prec.high( abbreviationTracker( ... ) )

If you're using some of the CodeMirror default extension lists, you may need that extra Precedence bump.

from codemirror6-plugin.

sergeche avatar sergeche commented on June 8, 2024

To clarify: If you use abbreviationTracker, you do not need a separate keymap for expandAbbreviation?

No, expandAbbreviation action should be used in case you want to expand abbreviation in some unsupported syntax like Markdown or Go (why not?). In supported syntaxes, if you want to expand by Tab, you should use abbreviation tracker since Tab key is very tricky to handle. Tracker contains all the logic to make it as smooth as possible

from codemirror6-plugin.

shshaw avatar shshaw commented on June 8, 2024

Tricky. I think my current setup of mapping languages to certain syntaxes is sufficient for the languages we'll support. Thanks for clarifying.

from codemirror6-plugin.

Related Issues (17)

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.