mirror of
				https://codeberg.org/adnano/wmenu.git
				synced 2025-11-03 09:01:46 -05:00 
			
		
		
		
	Don't set selection if there are no pages
This commit is contained in:
		
							parent
							
								
									7284f5958b
								
							
						
					
					
						commit
						da25fbfb27
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		
							
								
								
									
										2
									
								
								main.c
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								main.c
									
										
									
									
									
								
							| 
						 | 
					@ -236,8 +236,10 @@ static void match_items(struct menu *menu) {
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	page_items(menu);
 | 
						page_items(menu);
 | 
				
			||||||
 | 
						if (menu->pages) {
 | 
				
			||||||
		menu->sel = menu->pages->first;
 | 
							menu->sel = menu->pages->first;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void insert(struct menu *menu, const char *s, ssize_t n) {
 | 
					static void insert(struct menu *menu, const char *s, ssize_t n) {
 | 
				
			||||||
	if (strlen(menu->text) + n > sizeof menu->text - 1) {
 | 
						if (strlen(menu->text) + n > sizeof menu->text - 1) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue