瀏覽代碼

Add command to reverse marked images

master
Bastien Dejean 11 年之前
父節點
當前提交
562197577b
共有 5 個文件被更改,包括 18 次插入0 次删除
  1. +1
    -0
      README.md
  2. +12
    -0
      commands.c
  3. +1
    -0
      commands.h
  4. +1
    -0
      config.def.h
  5. +3
    -0
      sxiv.1

+ 1
- 0
README.md 查看文件

@@ -108,6 +108,7 @@ of small previews is displayed, making it easy to choose an image to open.
D Remove image from file list and go to next image

m Mark/unmark current image
M Reverse marked images
N Go [count] marked images forward
P Go [count] marked images backward



+ 12
- 0
commands.c 查看文件

@@ -251,6 +251,18 @@ bool it_toggle_image_mark(arg_t a)
return true;
}

bool it_reverse_marks(arg_t a)
{
int i, cnt = mode == MODE_IMAGE ? filecnt : tns.cnt;

for (i = 0; i < cnt; i++) {
files[i].marked = !files[i].marked;
markcnt += files[i].marked ? 1 : -1;
}

return true;
}

bool it_navigate_marked(arg_t a)
{
long n = (long) a;


+ 1
- 0
commands.h 查看文件

@@ -55,6 +55,7 @@ bool it_n_or_last(arg_t);
bool i_navigate_frame(arg_t);
bool i_toggle_animation(arg_t);
bool it_toggle_image_mark(arg_t);
bool it_reverse_marks(arg_t);
bool it_navigate_marked(arg_t);
bool it_scroll_move(arg_t);
bool it_scroll_screen(arg_t);


+ 1
- 0
config.def.h 查看文件

@@ -95,6 +95,7 @@ static const keymap_t keys[] = {
{ true, XK_space, i_toggle_animation, (arg_t) None },

{ false, XK_m, it_toggle_image_mark, (arg_t) None },
{ false, XK_M, it_reverse_marks, (arg_t) None },
{ false, XK_N, it_navigate_marked, (arg_t) +1 },
{ false, XK_P, it_navigate_marked, (arg_t) -1 },



+ 3
- 0
sxiv.1 查看文件

@@ -130,6 +130,9 @@ Remove current image from file list and go to next image.
.B m
Mark/unmark the current image.
.TP
.B M
Reverse marked images.
.TP
.B N
Go
.I count


Loading…
取消
儲存