-
-
Notifications
You must be signed in to change notification settings - Fork 733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add cmdline and runtime options to not move to next entry after select key #713
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -314,6 +314,7 @@ typedef struct { | |
uint selmode : 1; /* Set when selecting files */ | ||
uint oldcolor : 1; /* Show dirs in context colors */ | ||
uint reserved : 14; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @FriendlyNeighborhoodShane we should have made the reserved field 13 bits in width. We both missed this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whoops. haha. Thanks for informing me about this, didn't even realise that was futureproof padding at the end of the struct. I'm no C veteran, but I think both experienced and new hackers would benefit from a comment explicitly stating its purpose there. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. we should have a comment. |
||
uint stayonsel : 1; /* Disable auto-proceed on select */ | ||
} runstate; | ||
|
||
/* Contexts or workspaces */ | ||
|
@@ -6453,7 +6454,7 @@ static bool browse(char *ipath, const char *session, int pkey) | |
else | ||
#endif | ||
/* move cursor to the next entry if this is not the last entry */ | ||
if (!g_state.picker && cur != ndents - 1) | ||
if (!g_state.stayonsel && !g_state.picker && cur != ndents - 1) | ||
move_cursor((cur + 1) % ndents, 0); | ||
break; | ||
case SEL_SELMUL: | ||
|
@@ -7248,6 +7249,7 @@ static void usage(void) | |
" -F show fortune\n" | ||
" -g regex filters [default: string]\n" | ||
" -H show hidden files\n" | ||
" -j disable auto-proceed on select" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
saves a few bytes. |
||
" -K detect key collision\n" | ||
" -l val set scroll lines\n" | ||
" -n type-to-nav mode\n" | ||
|
@@ -7409,7 +7411,7 @@ int main(int argc, char *argv[]) | |
|
||
while ((opt = (env_opts_id > 0 | ||
? env_opts[--env_opts_id] | ||
: getopt(argc, argv, "aAb:cCdeEfFgHKl:nop:P:QrRs:St:T:uVwxh"))) != -1) { | ||
: getopt(argc, argv, "aAb:cCdeEfFgHjKl:nop:P:QrRs:St:T:uVwxh"))) != -1) { | ||
switch (opt) { | ||
#ifndef NOFIFO | ||
case 'a': | ||
|
@@ -7454,6 +7456,9 @@ int main(int argc, char *argv[]) | |
case 'H': | ||
cfg.showhidden = 1; | ||
break; | ||
case 'j': | ||
g_state.stayonsel = 1; | ||
break; | ||
case 'K': | ||
check_key_collision(); | ||
return EXIT_SUCCESS; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make this capital
J
. So far I am using the capital to disable things.