lib/gcli/languages/command.js
function(start) {
    if (!this.requisition.isUpToDate()) {
      return;
    }
    var newAssignment = this.requisition.getAssignmentAt(start);
    if (newAssignment == null) {
      return;
    }

    if (this.assignment !== newAssignment) {
      if (this.assignment.param.type.onLeave) {
        this.assignment.param.type.onLeave(this.assignment);
      }

      // This can be kicked off either by requisition doing an assign or by
      // terminal noticing a cursor movement out of a command, so we should
      // check that this really is a new assignment
      var isNew = (this.assignment !== newAssignment);

      this.assignment = newAssignment;
      this.terminal.updateCompletion().catch(util.errorHandler);

      if (isNew) {
        this.updateHints();
      }

      if (this.assignment.param.type.onEnter) {
        this.assignment.param.type.onEnter(this.assignment);
      }
    }
    else {
      if (this.assignment && this.assignment.param.type.onChange) {
        this.assignment.param.type.onChange(this.assignment);
      }
    }

    // Warning: compare the logic here with the logic in fieldChanged, which
    // is slightly different. They should probably be the same
    var error = (this.assignment.status === Status.ERROR);
    this.focusManager.setError(error);
  }
function(start) {
    if (!this.requisition.isUpToDate()) {
      return;
    }
    var newAssignment = this.requisition.getAssignmentAt(start);
    if (newAssignment == null) {
      return;
    }

    if (this.assignment !== newAssignment) {
      if (this.assignment.param.type.onLeave) {
        this.assignment.param.type.onLeave(this.assignment);
      }

      // This can be kicked off either by requisition doing an assign or by
      // terminal noticing a cursor movement out of a command, so we should
      // check that this really is a new assignment
      var isNew = (this.assignment !== newAssignment);

      this.assignment = newAssignment;
      this.terminal.updateCompletion().catch(util.errorHandler);

      if (isNew) {
        this.updateHints();
      }

      if (this.assignment.param.type.onEnter) {
        this.assignment.param.type.onEnter(this.assignment);
      }
    }
    else {
      if (this.assignment && this.assignment.param.type.onChange) {
        this.assignment.param.type.onChange(this.assignment);
      }
    }

    // Warning: compare the logic here with the logic in fieldChanged, which
    // is slightly different. They should probably be the same
    var error = (this.assignment.status === Status.ERROR);
    this.focusManager.setError(error);
  }
function ( start ) { if ( ! this . requisition . isUpToDate ( ) ) { return ; } var newAssignment = this . requisition . getAssignmentAt ( start ) ; if ( newAssignment == null ) { return ; } if ( this . assignment !== newAssignment ) { if ( this . assignment . param . type . onLeave ) { this . assignment . param . type . onLeave ( this . assignment ) ; } // This can be kicked off either by requisition doing an assign or by // terminal noticing a cursor movement out of a command, so we should // check that this really is a new assignment var isNew = ( this . assignment !== newAssignment ) ; this . assignment = newAssignment ; this . terminal . updateCompletion ( ) . catch ( util . errorHandler ) ; if ( isNew ) { this . updateHints ( ) ; } if ( this . assignment . param . type . onEnter ) { this . assignment . param . type . onEnter ( this . assignment ) ; } } else { if ( this . assignment && this . assignment . param . type . onChange ) { this . assignment . param . type . onChange ( this . assignment ) ; } } // Warning: compare the logic here with the logic in fieldChanged, which // is slightly different. They should probably be the same var error = ( this . assignment . status === Status . ERROR ) ; this . focusManager . setError ( error ) ; }
Called internally whenever we think that the current assignment might have changed, typically on mouse-clicks or key presses.
Called internally whenever we think that the current assignment might have changed typically on mouse - clicks or key presses .