GithubHelp home page GithubHelp logo

Comments (3)

clausreinke avatar clausreinke commented on July 26, 2024

You might be able to get the info you want from the undotree (:help undo, :help undotree() ). Depends on vi-nocompatible undo (&cpoptions) and suitably large &undolevels.

But using the filesystem version as a fallback synchronization, with &modified as an approximation of change, tends to work (coders tend to save changes in all but the current buffer, in which they tend to edit a lot). Unless you want to go all the way towards sending diffs only.

Vim has all kinds of special purpose interfaces for tool integration, instead of one generic solution (like Emacs has). That is its main disadvantage. Even the python interface has disadvantages (not every Vim install has the required python lib, and every Vim install is bound to a specific version of that python lib), but it comes close to being generic, and most users should be able to install the required python version.

I tend to code only the minimal part in python that can't be done in Vim, so if someone prefers the perl or ruby or scheme or ... interface, they'd only have to reproduce that part in their interface.

Most of the more specific interfaces, like the netbeans one, look tempting when you first find them, but you'd have to check carefully if the specific interface serves your purpose, all the way, because if there is anything that interface can't do, you're stuck completely.

As for availability: on my windows 7, my gvims have netbeans support enabled, my git bash terminal vim does not. Given the wide variety of vim configurations out there, I would not rely on it.

from tern.

marijnh avatar marijnh commented on July 26, 2024

The problem with &modified is that saves to disk and updates to the tern server are not happening at the same time.

For autocompletion, the user is probably typing already, so we'll have to send updated context anyway. But for a feature like showing function arguments, there might be a series of queries without changes to the buffer inbetween. That's the scenario I'd like to detect. The undo history trick might work -- I'll look into it.

from tern.

marijnh avatar marijnh commented on July 26, 2024

undotree()['seq_cur'] turns out to be perfect for my purpose -- I can save the sequence number at which I sent the file over, and compare against that for later requests.

See f72099c

from tern.

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.