Skip to content

Commit 4940267

Browse files
committed
Merge branch '4716_put_file_to_command_line'
* 4716_put_file_to_command_line: (put_tagged): refactroing. Ticket #4716: (put_tagged): put file from other panel to command line.
2 parents cf94283 + 20f0911 commit 4940267

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/filemanager/filemanager.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ put_current_selected (void)
773773
/* --------------------------------------------------------------------------------------------- */
774774

775775
static void
776-
put_tagged (WPanel *panel)
776+
put_tagged (const WPanel *panel)
777777
{
778778
if (!command_prompt)
779779
return;
@@ -782,20 +782,18 @@ put_tagged (WPanel *panel)
782782

783783
if (panel->marked == 0)
784784
{
785-
const file_entry_t *fe;
785+
const file_entry_t *fe = panel_current_entry (panel);
786786

787-
fe = panel_current_entry (current_panel);
788787
if (fe != NULL)
789788
command_insert (cmdline, fe->fname->str, TRUE);
790789
}
791790
else
792-
{
793-
int i;
794-
795-
for (i = 0; i < panel->dir.len; i++)
791+
for (int m = 0, i = 0; m < panel->marked && i < panel->dir.len; i++)
796792
if (panel->dir.list[i].f.marked != 0)
793+
{
797794
command_insert (cmdline, panel->dir.list[i].fname->str, TRUE);
798-
}
795+
m++;
796+
}
799797

800798
input_enable_update (cmdline);
801799
}

0 commit comments

Comments
 (0)