Comments (3)
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.
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.
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)
- Website still features "looking for maintainers" spiel HOT 1
- [Bug] The autocompletion for prototype HOT 3
- [BUG] defining the type for the argument of a function HOT 4
- how can i make any use of the !url tag?
- Tern plugin not avaliable in Jenkins
- require.js + defs
- es6 class arrow function method TypeError
- Function information tooltip
- No autocomplete on my objects HOT 2
- Failed to launch development process with webpack after installing tern@latest npm package HOT 2
- Bug fixed. Wrong filename for jump to definition
- acorn-lose error with tern 0.23.3 or up HOT 2
- Simple text search for tern HOT 4
- Is there any way to analyzed code in runtime?
- mix type definitions
- Using `es_modules` and `node` plugin together breaks jump to definition in some cases
- Jump to definition doesn't work from `export` es6 syntax
- Is Tern.js library in active development/support? HOT 9
- Tern not identifying js property references in the given case
- Avoid duplicate name definition
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tern.