summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-12-13 18:12:53 +0100
committerhut <hut@lavabit.com>2010-12-13 18:13:50 +0100
commitea45cca99102e2c0c2629c7129b2970e8a85a5fe (patch)
treea36e00dd87ec7f6e9ad153bd2fd6a7366c24e12f /ranger
parentee7f171116b57514e2ce11cb3b7932a22478be79 (diff)
downloadranger-ea45cca99102e2c0c2629c7129b2970e8a85a5fe.tar.gz
defaults.commands: Added search_inc(remental)
Diffstat (limited to 'ranger')
-rw-r--r--ranger/core/actions.py8
-rw-r--r--ranger/defaults/commands.py5
-rw-r--r--ranger/fsobject/directory.py10
3 files changed, 14 insertions, 9 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 51a70844..75f85baf 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -368,16 +368,16 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 	# -- Searching
 	# --------------------------
 
-	def search_file(self, text, regexp=True):
+	def search_file(self, text, offset=1, regexp=True):
 		if isinstance(text, str) and regexp:
 			try:
 				text = re.compile(text, re.L | re.U | re.I)
 			except:
 				return False
 		self.env.last_search = text
-		self.search(order='search')
+		self.search(order='search', offset=offset)
 
-	def search(self, order=None, forward=True):
+	def search(self, order=None, offset=1, forward=True):
 		original_order = order
 		if self.search_forward:
 			direction = bool(forward)
@@ -401,7 +401,7 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 			elif order == 'tag':
 				fnc = lambda x: x.realpath in self.tags
 
-			return self.env.cwd.search_fnc(fnc=fnc, forward=forward)
+			return self.env.cwd.search_fnc(fnc=fnc, offset=offset, forward=forward)
 
 		elif order in ('size', 'mimetype', 'ctime'):
 			cwd = self.env.cwd
diff --git a/ranger/defaults/commands.py b/ranger/defaults/commands.py
index 6258d30d..9861ddeb 100644
--- a/ranger/defaults/commands.py
+++ b/ranger/defaults/commands.py
@@ -91,6 +91,11 @@ class search(Command):
 		self.fm.search_file(parse(self.line).rest(1), regexp=True)
 
 
+class search_inc(Command):
+	def quick(self):
+		self.fm.search_file(parse(self.line).rest(1), regexp=True, offset=0)
+
+
 class shell(Command):
 	def execute(self):
 		line = parse(self.line)
diff --git a/ranger/fsobject/directory.py b/ranger/fsobject/directory.py
index 5d1a89a0..c5c1e6a9 100644
--- a/ranger/fsobject/directory.py
+++ b/ranger/fsobject/directory.py
@@ -339,18 +339,18 @@ class Directory(FileSystemObject, Accumulator, Loadable, SettingsAware):
 
 		Accumulator.move_to_obj(self, arg, attr='path')
 
-	def search_fnc(self, fnc, forward=True):
+	def search_fnc(self, fnc, offset=1, forward=True):
 		if not hasattr(fnc, '__call__'):
 			return False
 
 		length = len(self)
 
 		if forward:
-			generator = ((self.pointer + (x + 1)) % length \
-					for x in range(length-1))
+			generator = ((self.pointer + (x + offset)) % length \
+					for x in range(length - 1))
 		else:
-			generator = ((self.pointer - (x + 1)) % length \
-					for x in range(length-1))
+			generator = ((self.pointer - (x + offset)) % length \
+					for x in range(length - 1))
 
 		for i in generator:
 			_file = self.files[i]
am@wmii.de> 2006-07-13 09:32:22 +0200 committer Anselm R. Garbe <garbeam@wmii.de> 2006-07-13 09:32:22 +0200 added logo+description' href='/acidbong/suckless/dwm/commit/README?h=6.4&id=650a1fb4e1a798aca48a53739f5bb2649191bc1c'>650a1fb ^
1076f2b
eff4478 ^
1076f2b
7b5638f ^

98c6a92 ^
98c6a92 ^

02cea3b ^
7b5638f ^
2b66f7a ^
98c6a92 ^
7b5638f ^
1076f2b

dc5c070 ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
                            
                            
                                                                  

 

            
                                                     



            

                                                               
 
                                                                   



                      


                                                                             
 
           
           
                                                                  
 
            
 
                                                             

                                                        
                              
 
                                                        
 

                                                                
 

              
                                            
               
              
 
 

             

                                                              
dwm - dynamic window manager
============================
dwm is an extremely fast, small, and dynamic window manager for X.


Requirements
------------
In order to build dwm you need the Xlib header files.


Installation
------------
Edit config.mk to match your local setup (dwm is installed into
the /usr/local namespace by default).

Afterwards enter the following command to build and install dwm (if
necessary as root):

    make clean install

If you are going to use the default bluegray color scheme it is highly
recommended to also install the bluegray files shipped in the dextra package.


Running dwm
-----------
Add the following line to your .xinitrc to start dwm using startx:

    exec dwm

In order to connect dwm to a specific display, make sure that
the DISPLAY environment variable is set correctly, e.g.:

    DISPLAY=foo.bar:1 exec dwm

(This will start dwm on display :1 of the host foo.bar.)

In order to display status info in the bar, you can do something
like this in your .xinitrc:

    while true
    do
        echo `date` `uptime | sed 's/.*,//'`
        sleep 1
    done | dwm


Configuration
-------------
The configuration of dwm is done by creating a custom config.h
and (re)compiling the source code.