Ranger: mkcd now works properly!

master
Pierre Neidhardt 2013-11-12 19:40:24 +01:00
parent 8f5253c07e
commit 09db75b6d2
3 changed files with 13 additions and 23 deletions

View File

@ -1,2 +1,2 @@
}:exja (function(){var e=document.querySelector("[rel='next']");if(e){location=e.href;}else{var f=document.getElementsByTagName("a");var i=f.length;while((e=f[--i])){if(e.text.search(/(\bnext\b|^>$|^(>>|»)$|^(>|»)|(>|»)$|\bmore\b)/i)>-1){location=e.href; break;}} location.href=location.href.replace(/(\d+)([^\/\d]*)$/, function(a,b,c){return ++b+c})}})();
{:exja (function(){var e=document.querySelector("[rel='prev']");if(e){location=e.href;}else{var f=document.getElementsByTagName("a");var i=f.length;while((e=f[--i])){if(e.text.search(/(\b(prev|previous)\b|^<$|^(<<|«)$|^(<|«)|(<|«)$)/i)>-1){location=e.href;break;}} location.href=location.href.replace(/(\d+)([^\/\d]*)$/, function(a,b,c){return --b+c})}})();
{:exja (function(){var e=document.querySelector("[rel='prev']");if(e){location=e.href;}else{var f=document.getElementsByTagName("a");var i=f.length;while((e=f[--i])){if(e.text.search(/(\b(prev|previous)\b|^<$|^(<<|«)$|^(<|«)|(<|«)$)/i)>-1){location=e.href;break;}} location.href=location.href.replace(/(\d+)([^\/\d]*)$/, function(a,b,c){return --b+c})}})();

View File

@ -1,13 +0,0 @@
//!javascript
// Prevents previously-opened tabs from reloading all at once after a restart.
execute("set load-on-focus true");
var sigId = signals.connect("navigation", function(wv) {
if (wv == tabs.current)
{
execute("set load-on-focus false");
signals.disconnect(sigId);
}
});

View File

@ -93,22 +93,25 @@ class extracthere(Command):
obj.signal_bind('after', refresh)
self.fm.loader.add(obj)
class mkcd(Command):
def execute(self):
""" Create folder and cd to it """
"""
:mkcd <dirname>
Creates a directory with the name <dirname> and enters it.
"""
def execute(self):
from os.path import join, expanduser, lexists
from os.path import join, expanduser, lexists, basename
from os import mkdir
dirname = join(self.fm.thisdir.path, expanduser(self.rest(1)))
if not lexists(dirname):
mkdir(dirname)
if self.rest(1).startswith('.') and not self.fm.settings['show_hidden']:
self.fm.cd(dirname)
else:
self.fm.thisdir.load_content(schedule=False)
self.fm.execute_console('scout -ae ^{}$'.format(self.rest(1)))
else:
self.fm.notify("file/directory exists!", bad=True)
self.fm.cd(dirname)
def tab(self):
return self._tab_directory_content()