Ranger: mkcd now works properly!
parent
8f5253c07e
commit
09db75b6d2
|
@ -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='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})}})();
|
||||||
|
|
|
@ -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);
|
|
||||||
}
|
|
||||||
});
|
|
|
@ -93,22 +93,25 @@ class extracthere(Command):
|
||||||
obj.signal_bind('after', refresh)
|
obj.signal_bind('after', refresh)
|
||||||
self.fm.loader.add(obj)
|
self.fm.loader.add(obj)
|
||||||
|
|
||||||
|
|
||||||
class mkcd(Command):
|
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):
|
def execute(self):
|
||||||
from os.path import join, expanduser, lexists
|
from os.path import join, expanduser, lexists, basename
|
||||||
from os import mkdir
|
from os import mkdir
|
||||||
|
|
||||||
dirname = join(self.fm.thisdir.path, expanduser(self.rest(1)))
|
dirname = join(self.fm.thisdir.path, expanduser(self.rest(1)))
|
||||||
if not lexists(dirname):
|
if not lexists(dirname):
|
||||||
mkdir(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:
|
else:
|
||||||
self.fm.notify("file/directory exists!", bad=True)
|
self.fm.notify("file/directory exists!", bad=True)
|
||||||
|
|
||||||
self.fm.cd(dirname)
|
|
||||||
|
|
||||||
def tab(self):
|
|
||||||
return self._tab_directory_content()
|
|
||||||
|
|
Loading…
Reference in New Issue