Commits

Rui Abreu Ferreira  committed 67f6003

Improve NeoVimConnector::handleMetadata

- Renamed parameter **error** it shadowed the
error() method
- Moved ready() signal emit into handleMetadata
- Add comment

  • Participants
  • Parent commits 0c8ef0b

Comments (0)

Files changed (1)

File src/neovimconnector.cpp

 				tr("Cannot connect to this instance of NeoVim, its version is likely too old, or the API has changed"));
 		return;
 	}
-	emit ready();
 }
 
 /**
 	}
 }
 
-void NeoVimConnector::handleMetadata(uint32_t msgid, Function::FunctionId, bool error, const msgpack_object& result)
+/**
+ * Process metadata object returned by NeoVim
+ *
+ * - Set channel_id
+ * - Check if all functions we need are available
+ */
+void NeoVimConnector::handleMetadata(uint32_t msgid, Function::FunctionId, bool failed, const msgpack_object& result)
 {
-	if ( error ) {
+	if ( failed ) {
 		setError( NoMetadata,
 			tr("Unable to get NeoVim information"));
 		return;
 			addClasses(msg.data.via.map.ptr[i].val);
 		}
 	}
+
+	if (error() == NoError) {
+		emit ready();
+	}
 }
 
 /**