File src/normal.c changed (mode: 100644) (index d80246133..3423c21ec) |
... |
... |
static void find_f(int ch); |
112 |
112 |
static void cmd_ga(struct key_info, struct keys_info *); |
static void cmd_ga(struct key_info, struct keys_info *); |
113 |
113 |
static void cmd_gg(struct key_info, struct keys_info *); |
static void cmd_gg(struct key_info, struct keys_info *); |
114 |
114 |
static void selector_gg(struct key_info, struct keys_info *); |
static void selector_gg(struct key_info, struct keys_info *); |
|
115 |
|
static void cmd_gv(struct key_info, struct keys_info *); |
115 |
116 |
static void cmd_h(struct key_info, struct keys_info *); |
static void cmd_h(struct key_info, struct keys_info *); |
116 |
117 |
static void cmd_i(struct key_info, struct keys_info *); |
static void cmd_i(struct key_info, struct keys_info *); |
117 |
118 |
static void cmd_j(struct key_info, struct keys_info *); |
static void cmd_j(struct key_info, struct keys_info *); |
|
... |
... |
init_normal_mode(int *key_mode) |
332 |
333 |
curr = add_cmd(L"gg", NORMAL_MODE); |
curr = add_cmd(L"gg", NORMAL_MODE); |
333 |
334 |
curr->data.handler = cmd_gg; |
curr->data.handler = cmd_gg; |
334 |
335 |
|
|
|
336 |
|
curr = add_cmd(L"gv", NORMAL_MODE); |
|
337 |
|
curr->data.handler = cmd_gv; |
|
338 |
|
|
335 |
339 |
curr = add_cmd(L"h", NORMAL_MODE); |
curr = add_cmd(L"h", NORMAL_MODE); |
336 |
340 |
curr->data.handler = cmd_h; |
curr->data.handler = cmd_h; |
337 |
341 |
|
|
|
... |
... |
selector_gg(struct key_info key_info, struct keys_info *keys_info) |
755 |
759 |
pick_files(curr_view, key_info.count - 1, keys_info); |
pick_files(curr_view, key_info.count - 1, keys_info); |
756 |
760 |
} |
} |
757 |
761 |
|
|
|
762 |
|
static void |
|
763 |
|
cmd_gv(struct key_info key_info, struct keys_info *keys_info) |
|
764 |
|
{ |
|
765 |
|
enter_visual_mode(1); |
|
766 |
|
} |
|
767 |
|
|
758 |
768 |
/* Go to first file in window. */ |
/* Go to first file in window. */ |
759 |
769 |
static void |
static void |
760 |
770 |
cmd_H(struct key_info key_info, struct keys_info *keys_info) |
cmd_H(struct key_info key_info, struct keys_info *keys_info) |
|
... |
... |
cmd_P(struct key_info key_info, struct keys_info *keys_info) |
837 |
847 |
static void |
static void |
838 |
848 |
cmd_V(struct key_info key_info, struct keys_info *keys_info) |
cmd_V(struct key_info key_info, struct keys_info *keys_info) |
839 |
849 |
{ |
{ |
840 |
|
enter_visual_mode(); |
|
|
850 |
|
enter_visual_mode(0); |
841 |
851 |
} |
} |
842 |
852 |
|
|
843 |
853 |
static void |
static void |
File src/vifm.txt changed (mode: 100644) (index 527b05fbc..d5f719da1) |
... |
... |
DD and D<selector> - like dd and d<selector>, but omitting trash directory |
197 |
197 |
(even when option USE_TRASH is set). |
(even when option USE_TRASH is set). |
198 |
198 |
f, F, ;, <comma> - search by first character in filename. |
f, F, ;, <comma> - search by first character in filename. |
199 |
199 |
ga calculate size of directory. |
ga calculate size of directory. |
|
200 |
|
gv go to visual mode restoring last selection. |
200 |
201 |
yy, Y - yank selected files. |
yy, Y - yank selected files. |
201 |
202 |
y<selector> - yank files. |
y<selector> - yank files. |
202 |
203 |
p - put last selected files. |
p - put last selected files. |
File src/visual.c changed (mode: 100644) (index 6aa1da31e..d4194787c) |
... |
... |
init_visual_mode(int *key_mode) |
135 |
135 |
} |
} |
136 |
136 |
|
|
137 |
137 |
void |
void |
138 |
|
enter_visual_mode(void) |
|
|
138 |
|
enter_visual_mode(int restore_selection) |
139 |
139 |
{ |
{ |
140 |
140 |
int x; |
int x; |
141 |
141 |
|
|
|
... |
... |
enter_visual_mode(void) |
146 |
146 |
for(x = 0; x < view->list_rows; x++) |
for(x = 0; x < view->list_rows; x++) |
147 |
147 |
view->dir_entry[x].selected = 0; |
view->dir_entry[x].selected = 0; |
148 |
148 |
|
|
149 |
|
/* Don't allow the ../ dir to be selected */ |
|
150 |
|
if(strcmp(view->dir_entry[view->list_pos].name, "../")) |
|
|
149 |
|
if(restore_selection) |
151 |
150 |
{ |
{ |
|
151 |
|
int ub = check_mark_directory(view, '<'); |
|
152 |
|
int lb = check_mark_directory(view, '>'); |
|
153 |
|
|
|
154 |
|
if(ub > 0 && lb > 0) |
|
155 |
|
{ |
|
156 |
|
start_pos = ub; |
|
157 |
|
view->list_pos = ub; |
|
158 |
|
|
|
159 |
|
view->selected_files = 1; |
|
160 |
|
view->dir_entry[view->list_pos].selected = 1; |
|
161 |
|
|
|
162 |
|
while(view->list_pos != lb) |
|
163 |
|
select_down_one(view, start_pos); |
|
164 |
|
update(); |
|
165 |
|
} |
|
166 |
|
} |
|
167 |
|
else if(strcmp(view->dir_entry[view->list_pos].name, "../")) |
|
168 |
|
{ |
|
169 |
|
/* Don't allow the ../ dir to be selected */ |
152 |
170 |
view->selected_files = 1; |
view->selected_files = 1; |
153 |
171 |
view->dir_entry[view->list_pos].selected = 1; |
view->dir_entry[view->list_pos].selected = 1; |
154 |
172 |
} |
} |
|
... |
... |
enter_visual_mode(void) |
156 |
174 |
draw_dir_list(view, view->top_line, view->list_pos); |
draw_dir_list(view, view->top_line, view->list_pos); |
157 |
175 |
moveto_list_pos(view, view->list_pos); |
moveto_list_pos(view, view->list_pos); |
158 |
176 |
|
|
159 |
|
if(view->list_pos != 0) |
|
160 |
|
status_bar_message("-- VISUAL --\t1 File Selected"); |
|
161 |
|
else |
|
162 |
|
status_bar_message("-- VISUAL --"); |
|
163 |
|
curr_stats.save_msg = 1; |
|
164 |
|
|
|
165 |
177 |
update_marks(view); |
update_marks(view); |
166 |
178 |
} |
} |
167 |
179 |
|
|
|
... |
... |
select_up_one(FileView *view, int start_pos) |
410 |
422 |
view->list_pos--; |
view->list_pos--; |
411 |
423 |
if(view->list_pos < 0) |
if(view->list_pos < 0) |
412 |
424 |
{ |
{ |
413 |
|
if (start_pos == 0) |
|
|
425 |
|
if(start_pos == 0) |
414 |
426 |
view->selected_files = 0; |
view->selected_files = 0; |
415 |
427 |
view->list_pos = 0; |
view->list_pos = 0; |
416 |
428 |
} |
} |