Add M-a to switch to hot or unread window
This commit is contained in:
		
							parent
							
								
									9d6f9d76c3
								
							
						
					
					
						commit
						23ec3fd1b7
					
				@ -1,4 +1,4 @@
 | 
				
			|||||||
.Dd February 23, 2019
 | 
					.Dd February 25, 2019
 | 
				
			||||||
.Dt CATGIRL 1
 | 
					.Dt CATGIRL 1
 | 
				
			||||||
.Os
 | 
					.Os
 | 
				
			||||||
.
 | 
					.
 | 
				
			||||||
@ -300,7 +300,9 @@ Redraw the UI.
 | 
				
			|||||||
.It Ic C-n
 | 
					.It Ic C-n
 | 
				
			||||||
Switch to the next window.
 | 
					Switch to the next window.
 | 
				
			||||||
.It Ic C-p
 | 
					.It Ic C-p
 | 
				
			||||||
Swittch to the previous window.
 | 
					Switch to the previous window.
 | 
				
			||||||
 | 
					.It Ic M-a
 | 
				
			||||||
 | 
					Switch to next hot or unread window.
 | 
				
			||||||
.It Ic M-m
 | 
					.It Ic M-m
 | 
				
			||||||
Insert a blank line in the window.
 | 
					Insert a blank line in the window.
 | 
				
			||||||
.It Ic M- Ns Ar n
 | 
					.It Ic M- Ns Ar n
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										14
									
								
								ui.c
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								ui.c
									
									
									
									
									
								
							@ -367,6 +367,19 @@ void uiShowNum(int num, bool relative) {
 | 
				
			|||||||
	uiPrompt(false);
 | 
						uiPrompt(false);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static void uiShowAuto(void) {
 | 
				
			||||||
 | 
						struct Window *unread = NULL;
 | 
				
			||||||
 | 
						struct Window *hot;
 | 
				
			||||||
 | 
						for (hot = windows.head; hot; hot = hot->next) {
 | 
				
			||||||
 | 
							if (hot->hot) break;
 | 
				
			||||||
 | 
							if (!unread && hot->unread) unread = hot;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						if (!hot && !unread) return;
 | 
				
			||||||
 | 
						windowShow(hot ? hot : unread);
 | 
				
			||||||
 | 
						uiStatus();
 | 
				
			||||||
 | 
						uiPrompt(false);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void uiCloseTag(struct Tag tag) {
 | 
					void uiCloseTag(struct Tag tag) {
 | 
				
			||||||
	windowClose(windowFor(tag));
 | 
						windowClose(windowFor(tag));
 | 
				
			||||||
	uiStatus();
 | 
						uiStatus();
 | 
				
			||||||
@ -447,6 +460,7 @@ static void keyCode(wchar_t code) {
 | 
				
			|||||||
static void keyMeta(wchar_t ch) {
 | 
					static void keyMeta(wchar_t ch) {
 | 
				
			||||||
	struct Window *win = windows.active;
 | 
						struct Window *win = windows.active;
 | 
				
			||||||
	if (ch >= L'0' && ch <= L'9') uiShowNum(ch - L'0', false);
 | 
						if (ch >= L'0' && ch <= L'9') uiShowNum(ch - L'0', false);
 | 
				
			||||||
 | 
						if (ch == L'a') uiShowAuto();
 | 
				
			||||||
	if (!win) return;
 | 
						if (!win) return;
 | 
				
			||||||
	switch (ch) {
 | 
						switch (ch) {
 | 
				
			||||||
		break; case L'b':  edit(win->tag, EditBackWord, 0);
 | 
							break; case L'b':  edit(win->tag, EditBackWord, 0);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user