summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorleo-arch <leonardoabramovich2@gmail.com>2024-04-27 00:52:50 -0300
committerleo-arch <leonardoabramovich2@gmail.com>2024-04-27 00:52:50 -0300
commit24e62fae82259c804f621c60749ec1dfbdbec258 (patch)
tree93eaeddace2dee9c9ad83d1f28cd1222c3ec6817
parent318cad1b951c9747fb13c2e57505732645230635 (diff)
Fix cursor position when suggesting
-rw-r--r--src/file_operations.c9
-rw-r--r--src/suggestions.c3
2 files changed, 6 insertions, 6 deletions
diff --git a/src/file_operations.c b/src/file_operations.c
index 50b979e8..e5a66c4b 100644
--- a/src/file_operations.c
+++ b/src/file_operations.c
@@ -889,7 +889,7 @@ err_no_link(const char *file)
if (tlen != -1)
target[tlen] = '\0';
- xerror(_("open: '%s': Broken symbolic link to %s\n"), file,
+ xerror(_("open: '%s': Broken symbolic link to '%s'\n"), file,
*target ? target : "???");
return saved_errno;
@@ -1206,14 +1206,13 @@ symlink_file(char **args)
return FUNC_SUCCESS;
if (unlinkat(XAT_FDCWD, link_name, 0) == -1) {
- xerror("link: unlink: '%s': %s\n", link_name, strerror(errno));
+ xerror(_("link: Cannot unlink '%s': %s\n"),
+ link_name, strerror(errno));
return FUNC_FAILURE;
}
}
- const int ret = symlinkat(target, XAT_FDCWD, link_name);
-
- if (ret == -1) {
+ if (symlinkat(target, XAT_FDCWD, link_name) == -1) {
xerror(_("link: Cannot create symbolic link '%s': %s\n"),
link_name, strerror(errno));
return FUNC_FAILURE;
diff --git a/src/suggestions.c b/src/suggestions.c
index e98eeafa..cfc55e72 100644
--- a/src/suggestions.c
+++ b/src/suggestions.c
@@ -474,7 +474,8 @@ calculate_suggestion_lines(int *baej, const size_t suggestion_len)
|| suggestion.type == JCMD_SUG_NOACD || suggestion.type == BACKDIR_SUG
|| suggestion.type == SORT_SUG || suggestion.type == WS_NUM_SUG
|| suggestion.type == FUZZY_FILENAME || suggestion.type == DIRHIST_SUG
- || suggestion.type == FASTBACK_SUG) {
+ || suggestion.type == FASTBACK_SUG
+ || (suggestion.type == COMP_SUG && (flags & BAEJ_SUGGESTION))) {
/* 3 = 1 (one char forward) + 2 (" >") */
cuc += 3;
flags |= BAEJ_SUGGESTION;