File ChangeLog changed (mode: 100644) (index 4e2101776..5f84b0d8a) |
158 |
158 |
Provide numerical value of a color as a description of a completion item |
Provide numerical value of a color as a description of a completion item |
159 |
159 |
for it. |
for it. |
160 |
160 |
|
|
|
161 |
|
Make :goto preserve custom and tree views. Thanks to |
|
162 |
|
asmodeus812 (Svetlozar Iliev). |
|
163 |
|
|
161 |
164 |
Fixed line number column not including padding to the left of it. |
Fixed line number column not including padding to the left of it. |
162 |
165 |
|
|
163 |
166 |
Fixed local options not being loaded on Ctrl-W x. |
Fixed local options not being loaded on Ctrl-W x. |
File src/cmd_handlers.c changed (mode: 100644) (index 02dc65a8e..a617f7644) |
... |
... |
goto_path_cmd(const cmd_info_t *cmd_info) |
2731 |
2731 |
|
|
2732 |
2732 |
fname = strdup(get_last_path_component(abs_path)); |
fname = strdup(get_last_path_component(abs_path)); |
2733 |
2733 |
remove_last_path_component(abs_path); |
remove_last_path_component(abs_path); |
2734 |
|
navigate_to_file(curr_view, abs_path, fname, 0); |
|
|
2734 |
|
navigate_to_file(curr_view, abs_path, fname, 1); |
2735 |
2735 |
free(fname); |
free(fname); |
2736 |
2736 |
return 0; |
return 0; |
2737 |
2737 |
} |
} |
File tests/commands/goto.c changed (mode: 100644) (index 93f29076d..080cfe78d) |
... |
... |
TEST(goto_navigates) |
56 |
56 |
assert_string_equal("tree", get_current_file_name(&lwin)); |
assert_string_equal("tree", get_current_file_name(&lwin)); |
57 |
57 |
} |
} |
58 |
58 |
|
|
|
59 |
|
TEST(goto_preserves_cv) |
|
60 |
|
{ |
|
61 |
|
char path[PATH_MAX + 1]; |
|
62 |
|
|
|
63 |
|
make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), TEST_DATA_PATH, |
|
64 |
|
"existing-files", NULL); |
|
65 |
|
|
|
66 |
|
flist_custom_start(&lwin, "test"); |
|
67 |
|
snprintf(path, sizeof(path), "%s/%s", test_data, "existing-files/a"); |
|
68 |
|
flist_custom_add(&lwin, path); |
|
69 |
|
snprintf(path, sizeof(path), "%s/%s", test_data, "existing-files/b"); |
|
70 |
|
flist_custom_add(&lwin, path); |
|
71 |
|
assert_true(flist_custom_finish(&lwin, CV_REGULAR, 0) == 0); |
|
72 |
|
|
|
73 |
|
assert_success(cmds_dispatch("goto b", &lwin, CIT_COMMAND)); |
|
74 |
|
assert_int_equal(1, lwin.list_pos); |
|
75 |
|
assert_true(flist_custom_active(&lwin)); |
|
76 |
|
|
|
77 |
|
assert_success(cmds_dispatch("goto a", &lwin, CIT_COMMAND)); |
|
78 |
|
assert_int_equal(0, lwin.list_pos); |
|
79 |
|
assert_true(flist_custom_active(&lwin)); |
|
80 |
|
} |
|
81 |
|
|
|
82 |
|
TEST(goto_preserves_tree) |
|
83 |
|
{ |
|
84 |
|
make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), TEST_DATA_PATH, "tree", |
|
85 |
|
NULL); |
|
86 |
|
assert_success(cmds_dispatch1("tree", &lwin, CIT_COMMAND)); |
|
87 |
|
assert_true(cv_tree(lwin.custom.type)); |
|
88 |
|
|
|
89 |
|
assert_success(cmds_dispatch("goto dir1/file4", &lwin, CIT_COMMAND)); |
|
90 |
|
assert_int_equal(7, lwin.list_pos); |
|
91 |
|
assert_true(cv_tree(lwin.custom.type)); |
|
92 |
|
|
|
93 |
|
assert_success(cmds_dispatch("goto dir5/file5", &lwin, CIT_COMMAND)); |
|
94 |
|
assert_int_equal(10, lwin.list_pos); |
|
95 |
|
assert_true(cv_tree(lwin.custom.type)); |
|
96 |
|
} |
|
97 |
|
|
59 |
98 |
TEST(goto_normalizes_slashes, IF(windows)) |
TEST(goto_normalizes_slashes, IF(windows)) |
60 |
99 |
{ |
{ |
61 |
100 |
char cmd[PATH_MAX*2]; |
char cmd[PATH_MAX*2]; |