Skip to content

Commit

Permalink
more 5030.3
Browse files Browse the repository at this point in the history
  • Loading branch information
alabuzhev committed Sep 20, 2017
1 parent d27f488 commit a77b630
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
4 changes: 4 additions & 0 deletions far/changelog
@@ -1,3 +1,7 @@
drkns 20.09.2017 21:35:37 +0100 - build 5035

1. Продолжение 5030.3.

drkns 20.09.2017 07:37:25 +0100 - build 5034

1. Уточнение 5032.
Expand Down
21 changes: 12 additions & 9 deletions far/shortcuts.cpp
Expand Up @@ -510,18 +510,19 @@ int Shortcuts::Configure()
UpdateItem();
};

auto& CurrentList = AllShortcuts[Pos].m_Items;
auto& CurrentList = AllShortcuts[Pos];

switch (Key)
{
case KEY_NUMPAD0:
case KEY_INS:
// Direct insertion only allowed if the list is empty. Otherwise do it in a submenu.
if (CurrentList.empty())
if (CurrentList.m_Items.empty())
{
if (Accept())
{
CurrentList.emplace_back(CreateShortcutFromPanel());
CurrentList.m_Items.emplace_back(CreateShortcutFromPanel());
CurrentList.m_Changed = true;
UpdateItem();
}
}
Expand All @@ -533,12 +534,13 @@ int Shortcuts::Configure()

case KEY_NUMDEL:
case KEY_DEL:
if (!CurrentList.empty())
if (!CurrentList.m_Items.empty())
{
// Direct deletion only allowed if there's exactly one item in the list. Otherwise do it in a submenu.
if (CurrentList.size() == 1)
if (CurrentList.m_Items.size() == 1)
{
CurrentList.pop_front();
CurrentList.m_Items.pop_front();
CurrentList.m_Changed = true;
UpdateItem();
}
else
Expand All @@ -549,13 +551,14 @@ int Shortcuts::Configure()
return true;

case KEY_F4:
if (!CurrentList.empty())
if (!CurrentList.m_Items.empty())
{
// Direct editing only allowed if there's exactly one item in the list. Otherwise do it in a submenu.
if (CurrentList.size() == 1)
if (CurrentList.m_Items.size() == 1)
{
if (EditListItem(AllShortcuts[Pos].m_Items, *FolderList, CurrentList.front(), true))
if (EditListItem(AllShortcuts[Pos].m_Items, *FolderList, CurrentList.m_Items.front(), true))
{
CurrentList.m_Changed = true;
UpdateItem();
}
}
Expand Down
2 changes: 1 addition & 1 deletion far/vbuild.m4
@@ -1 +1 @@
m4_define(BUILD,5034)m4_dnl
m4_define(BUILD,5035)m4_dnl

0 comments on commit a77b630

Please sign in to comment.