Git Product home page Git Product logo

Comments (8)

Shadowfiend avatar Shadowfiend commented on September 2, 2024

You actually should be able to do most of this by using the syntax highlighting. You should be able to add a scope to a given character range and then have the theme set certain properties based on that. Unfortunately wavy underlines aren't part of the supported options, I don't think, mostly because they're not built in to Cocoa.

I added some of this experimentally to vico-ensime a while back: https://github.com/Shadowfiend/vico-ensime.vicobundle/blob/master/ensime-status-commands.nu . I chose the scope severity.(warning|error), I believe. I did have to edit the theme file directly; it would probably be ideal if there were a default set for those theme settings.

Notably, spellcheck underlines have switched to dashed underlines instead of wavy, so that may be a possibility.

from vico.

Shadowfiend avatar Shadowfiend commented on September 2, 2024

I've tagged this feature, which I'll use to track a built-in way of doing this highlighting.

If you have access to this information, it'd be handy if you could see what if any scopes TextMate uses for these, if TextMate has this ability.

from vico.

jordwalke avatar jordwalke commented on September 2, 2024

Oh wow - that's awesome. I'm not set on wavy underlines - dotted probably look even better IMHO. So then I just need the ability (some kind of hook) to be able to reevaluate the syntax on every keystroke I believe (with some kind of delay + debounce). If your vico-ensime plugin already does this then I can just copy it and begin writing the javascript highlighter.

IIRC: There are some textmate themes with error colors - so we could use those - but would there be a way to just use the "misspelling dotted underline" IMHO it looks the best! Can we simply mark a region as "incorrectly spelled"?

from vico.

Shadowfiend avatar Shadowfiend commented on September 2, 2024

I'm tempted to leave it up to the theme rather than forcing a setting on the user, though I'm open to suggestions.

I still need to look into exposing the dotted underline style, however.

from vico.

jordwalke avatar jordwalke commented on September 2, 2024

Yeah - I always wished it was themeable in Macvim.

What do I have to do to get the script to be reevaluated continually (after some elapsed time of non-typing?) Where's the place I can start looking?

from vico.

Shadowfiend avatar Shadowfiend commented on September 2, 2024

The Vico API docs are actually still reasonably up-to-date. caretDidMove is the event that is current exposed that is perhaps best suited to this, though it'd be nice to expose an event for the actual text changing (say, when you leave insert mode). Right now it will be a bit noisy, since it'll be all caret movement, not just that caused by typing.

For the part where you wait a certain amount of time, you can use NSTimer to schedule a selector invocation after a certain interval, and use invalidate on the timer to stop it if the user takes action in the meantime.

from vico.

jordwalke avatar jordwalke commented on September 2, 2024

I started playing with this and it looks like some of the example scripts are outdated.
Do you know why ((document fileURL) path) no longer works? What's the new way to get the path of a document?

from vico.

Shadowfiend avatar Shadowfiend commented on September 2, 2024

I think you want ((current-document) fileURL).

from vico.

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.