aboutsummaryrefslogtreecommitdiffstats
path: root/core/ui.inc
diff options
context:
space:
mode:
Diffstat (limited to 'core/ui.inc')
-rw-r--r--core/ui.inc45
1 files changed, 45 insertions, 0 deletions
diff --git a/core/ui.inc b/core/ui.inc
index 26b6fa09..4f5b1fdc 100644
--- a/core/ui.inc
+++ b/core/ui.inc
@@ -108,6 +108,8 @@ enter_char: test byte [FuncFlag],1
not_ascii:
cmp al,0Dh ; Enter
je command_done
+ cmp al,09h ; Tab
+ je display_labels
cmp al,'F' & 1Fh ; <Ctrl-F>
je set_func_flag
%if IS_PXELINUX
@@ -142,6 +144,49 @@ set_func_flag:
mov byte [FuncFlag],1
jmp short get_char_2
+display_labels:
+ cmp word [NoComplete],0 ; Label completion enabled?
+ jne get_char_2
+ push di ; Save pointer
+ mov cx,di
+ sub cx,command_line
+ call crlf
+ mov esi,[HighMemSize] ; Start from top of memory
+.scan:
+ cmp esi,[VKernelEnd]
+ jbe .not_vk
+
+ push cx ; save command line size
+
+ mov di,VKernelBuf
+ call rllunpack
+ ; ESI updated on return
+
+ sub di,cx ; Return to beginning of buf
+ pop cx ; restore command line size
+ push si ; save SI
+ cmp cx,0
+ jz .print
+ push di
+ push cx
+ mov si,command_line
+ es repe cmpsb
+ pop cx
+ pop di
+ jne .next
+.print:
+ mov al,' '
+ call writechr
+
+ mov si,di
+ call writestr
+.next:
+ pop si ; restore SI
+ jmp .scan
+.not_vk:
+ call crlf
+ jmp fk_wrcmd
+
ctrl_f:
xor ah,ah
mov [FuncFlag],ah