File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -103,15 +103,19 @@ export class NeovimManager {
103
103
104
104
// For regular Vim commands
105
105
await nvim . setVvar ( 'errmsg' , '' ) ;
106
- await nvim . command ( normalizedCommand ) ;
107
-
106
+
107
+ // Execute the command and capture its output using the execute() function
108
+ const output = await nvim . call ( 'execute' , [ normalizedCommand ] ) ;
109
+
110
+ // Check for errors
108
111
const vimerr = await nvim . getVvar ( 'errmsg' ) ;
109
112
if ( vimerr ) {
110
113
console . error ( 'Vim error:' , vimerr ) ;
111
114
return `Error executing command: ${ vimerr } ` ;
112
115
}
113
116
114
- return 'Command executed' ;
117
+ // Return the actual command output if any
118
+ return output ? String ( output ) . trim ( ) : 'Command executed (no output)' ;
115
119
} catch ( error ) {
116
120
console . error ( 'Error sending command:' , error ) ;
117
121
return 'Error executing command' ;
You can’t perform that action at this time.
0 commit comments