A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/neovim/neovim/commit/2be938a2513b1dd604ce0069667b89a64441cb2a below:

report connection error, missing return values · neovim/neovim@2be938a · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+18

-7

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+18

-7

lines changed Original file line number Diff line number Diff line change

@@ -820,9 +820,13 @@ static void handle_remote_client(mparm_T *params, int remote_args,

820 820

if (server_addr != NULL) {

821 821

rc_id = channel_connect(false, server_addr, true, on_data, 50, &error);

822 822

}

823 - 824 -

Boolean should_exit = true;

825 -

Boolean tabbed;

823 +

if (error) {

824 +

mch_msg("Failed to connect to server ");

825 +

mch_msg(server_addr);

826 +

mch_msg("\nReason: ");

827 +

mch_msg(error);

828 +

mch_msg("Continuing with remote command in case we can execute locally\n");

829 +

}

826 830 827 831

int t_argc = remote_args;

828 832

Array args = ARRAY_DICT_INIT;

@@ -853,6 +857,9 @@ static void handle_remote_client(mparm_T *params, int remote_args,

853 857

os_exit(2);

854 858

}

855 859 860 +

TriState should_exit = kNone;

861 +

TriState tabbed = kNone;

862 + 856 863

for (size_t i = 0; i < rvobj.data.dictionary.size ; i++) {

857 864

if (strcmp(rvobj.data.dictionary.items[i].key.data, "errmsg") == 0) {

858 865

if (rvobj.data.dictionary.items[i].value.type != kObjectTypeString) {

@@ -867,21 +874,25 @@ static void handle_remote_client(mparm_T *params, int remote_args,

867 874

mch_errmsg("vim._cs_remote returned an unexpected type for 'tabbed'\n");

868 875

os_exit(2);

869 876

}

870 -

tabbed = rvobj.data.dictionary.items[i].value.data.boolean;

877 +

tabbed = rvobj.data.dictionary.items[i].value.data.boolean ? kTrue : kFalse;

871 878

} else if (strcmp(rvobj.data.dictionary.items[i].key.data, "should_exit") == 0) {

872 879

if (rvobj.data.dictionary.items[i].value.type != kObjectTypeBoolean) {

873 880

mch_errmsg("vim._cs_remote returned an unexpected type for 'should_exit'\n");

874 881

os_exit(2);

875 882

}

876 -

should_exit = rvobj.data.dictionary.items[i].value.data.boolean;

883 +

should_exit = rvobj.data.dictionary.items[i].value.data.boolean ? kTrue : kFalse;

877 884

}

878 885

}

886 +

if (should_exit == kNone || tabbed == kNone) {

887 +

mch_errmsg("vim._cs_remote didn't return a value for should_exit or tabbed, bailing\n");

888 +

os_exit(2);

889 +

}

879 890

api_free_object(o);

880 891 881 -

if (should_exit) {

892 +

if (should_exit == kTrue) {

882 893

os_exit(0);

883 894

}

884 -

if (tabbed) {

895 +

if (tabbed == kTrue) {

885 896

params->window_count = argc - remote_args - 1;

886 897

params->window_layout = WIN_TABS;

887 898

}

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4