File src/modes/view.c changed (mode: 100644) (index 4c5a1051c..efa912162) |
... |
... |
static void pick_current_viewer(modview_info_t *vi); |
174 |
174 |
static void replace_vi(modview_info_t *orig, modview_info_t *new); |
static void replace_vi(modview_info_t *orig, modview_info_t *new); |
175 |
175 |
static void cmd_a(key_info_t key_info, keys_info_t *keys_info); |
static void cmd_a(key_info_t key_info, keys_info_t *keys_info); |
176 |
176 |
static void switch_viewer(modview_info_t *vi, int offset); |
static void switch_viewer(modview_info_t *vi, int offset); |
|
177 |
|
static int get_viewer_index(const modview_info_t *vi); |
177 |
178 |
static void cmd_b(key_info_t key_info, keys_info_t *keys_info); |
static void cmd_b(key_info_t key_info, keys_info_t *keys_info); |
178 |
179 |
static void cmd_d(key_info_t key_info, keys_info_t *keys_info); |
static void cmd_d(key_info_t key_info, keys_info_t *keys_info); |
179 |
180 |
static void cmd_f(key_info_t key_info, keys_info_t *keys_info); |
static void cmd_f(key_info_t key_info, keys_info_t *keys_info); |
|
... |
... |
switch_viewer(modview_info_t *vi, int offset) |
1234 |
1235 |
return; |
return; |
1235 |
1236 |
} |
} |
1236 |
1237 |
|
|
1237 |
|
int i; |
|
1238 |
|
for(i = 0; i < vi->viewers.nitems; ++i) |
|
1239 |
|
{ |
|
1240 |
|
if(vi->viewers.items[i] == vi->curr_viewer) |
|
1241 |
|
{ |
|
1242 |
|
break; |
|
1243 |
|
} |
|
1244 |
|
} |
|
1245 |
|
if(i == vi->viewers.nitems) |
|
|
1238 |
|
int i = get_viewer_index(vi); |
|
1239 |
|
if(i < 0) |
1246 |
1240 |
{ |
{ |
1247 |
1241 |
return; |
return; |
1248 |
1242 |
} |
} |
|
... |
... |
switch_viewer(modview_info_t *vi, int offset) |
1260 |
1254 |
reload_view(vi, NOSILENT); |
reload_view(vi, NOSILENT); |
1261 |
1255 |
} |
} |
1262 |
1256 |
|
|
|
1257 |
|
/* Retrieves index of the current viewer. Returns the index or -1. */ |
|
1258 |
|
static int |
|
1259 |
|
get_viewer_index(const modview_info_t *vi) |
|
1260 |
|
{ |
|
1261 |
|
int i; |
|
1262 |
|
for(i = 0; i < vi->viewers.nitems; ++i) |
|
1263 |
|
{ |
|
1264 |
|
if(vi->viewers.items[i] == vi->curr_viewer) |
|
1265 |
|
{ |
|
1266 |
|
return i; |
|
1267 |
|
} |
|
1268 |
|
} |
|
1269 |
|
|
|
1270 |
|
return -1; |
|
1271 |
|
} |
|
1272 |
|
|
1263 |
1273 |
static void |
static void |
1264 |
1274 |
cmd_b(key_info_t key_info, keys_info_t *keys_info) |
cmd_b(key_info_t key_info, keys_info_t *keys_info) |
1265 |
1275 |
{ |
{ |