Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a008828

Browse files
committedOct 1, 2020
Special case for regular space
1 parent e99884a commit a008828

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
 

‎src/nvim/nvim.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,13 @@ void NvimSendModifiedInput(Nvim *nvim, const char *input, bool virtual_key) {
282282
}
283283

284284
void NvimSendChar(Nvim *nvim, wchar_t input_char) {
285+
// If the space is simply a regular space,
286+
// simply send the modified input
287+
if(input_char == VK_SPACE) {
288+
NvimSendModifiedInput(nvim, "Space", true);
289+
return;
290+
}
291+
285292
char utf8_encoded[64]{};
286293
if(!WideCharToMultiByte(CP_UTF8, 0, &input_char, 1, 0, 0, NULL, NULL)) {
287294
return;
@@ -301,7 +308,7 @@ void NvimSendChar(Nvim *nvim, wchar_t input_char) {
301308

302309
void NvimSendSysChar(Nvim *nvim, wchar_t input_char) {
303310
char utf8_encoded[64]{};
304-
if(WideCharToMultiByte(CP_UTF8, 0, &input_char, 1, 0, 0, NULL, NULL) == 0) {
311+
if(!WideCharToMultiByte(CP_UTF8, 0, &input_char, 1, 0, 0, NULL, NULL)) {
305312
return;
306313
}
307314
WideCharToMultiByte(CP_UTF8, 0, &input_char, 1, utf8_encoded, 64, NULL, NULL);

0 commit comments

Comments
 (0)
Please sign in to comment.