summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/source/commands.rst10
-rw-r--r--src/core/commands.py6
-rw-r--r--src/core/core.py3
3 files changed, 14 insertions, 5 deletions
diff --git a/doc/source/commands.rst b/doc/source/commands.rst
index 746fbafb..7a6346c5 100644
--- a/doc/source/commands.rst
+++ b/doc/source/commands.rst
@@ -141,12 +141,14 @@ These commands work in *any* tab.
/move_tab
**Usage:** ``/move_tab <source> <destination>``
- Move tab <source> to <destination>. If
- the create_gaps option is true, then it will leave a gap at the <source>
- position, leading to usual behaviour. If create_gaps is not enabled, then the
- tabs will number from 0 to your actual tab number, without gaps (which means
+ Move tab <source> to <destination>. If the :term:`create_gaps` option
+ is true, then it will leave a gap at the <source> position, leading
+ to usual behaviour. If create_gaps is not enabled, then the tabs will
+ number from 0 to your actual tab number, without gaps (which means
their number will change if you close a tab on the left of the list).
+ A value of ``.`` for a parameter means the current tab.
+
/theme
**Usage:** ``/theme [theme_name]``
diff --git a/src/core/commands.py b/src/core/commands.py
index f2a6d2f4..39bf505d 100644
--- a/src/core/commands.py
+++ b/src/core/commands.py
@@ -218,6 +218,12 @@ def command_move_tab(self, arg):
current_tab = self.current_tab()
if len(args) != 2:
return self.command_help('move_tab')
+
+ if args[0] == '.':
+ args[0] = current_tab.nb
+ if args[1] == '.':
+ args[1] = current_tab.nb
+
def get_nb_from_value(value):
ref = None
try:
diff --git a/src/core/core.py b/src/core/core.py
index 39eb31b7..41cb9586 100644
--- a/src/core/core.py
+++ b/src/core/core.py
@@ -1466,7 +1466,8 @@ class Core(object):
"<destination>. This will make the following tabs shift in"
" some cases (refer to the documentation). A tab can be "
"designated by its number or by the beginning of its "
- "address."),
+ "address. You can use \".\" as a shortcut for the current "
+ "tab."),
shortdesc=_('Move a tab.'),
completion=self.completion_move_tab)
self.register_command('show', self.command_status,