From fa2d4744e11cdd421bc65f2cc85e100854474a4e Mon Sep 17 00:00:00 2001
From: Franco Pariani <franco19ps@gmail.com>
Date: Mon, 17 Dec 2018 01:12:23 -0300
Subject: [PATCH] Enable/Disable hints

---
 .../src/app/layout/matefun/matefun.component.html    |  5 +++++
 .../src/app/layout/matefun/matefun.component.ts      | 12 ++++++++----
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/Frontend Angular 4/src/app/layout/matefun/matefun.component.html b/Frontend Angular 4/src/app/layout/matefun/matefun.component.html
index c1bcee03..8b7ff0a1 100755
--- a/Frontend Angular 4/src/app/layout/matefun/matefun.component.html	
+++ b/Frontend Angular 4/src/app/layout/matefun/matefun.component.html	
@@ -60,6 +60,11 @@
                                         <input type="checkbox" style="width: 15px; display: inline-block;" name="argumentoI" class="form-control form-control-sm" [(ngModel)]=argumentoI>
                                         Mostrar advertencias de uso de operadores infijos
                                     </label>
+                                    <br>
+                                    <label>
+                                        <input type="checkbox" style="width: 15px; display: inline-block;" name="hintsCheck" class="form-control form-control-sm" [(ngModel)]=hintsCheck (change)="changeHints()">
+                                        Mostrar sugerencias de autocompletar
+                                    </label>
                                 </div>
                                 <div class="form-group">
                                     <button class="btn btn-secondary" (click)="saveConfig()">Guardar</button>
diff --git a/Frontend Angular 4/src/app/layout/matefun/matefun.component.ts b/Frontend Angular 4/src/app/layout/matefun/matefun.component.ts
index 7040c85b..f7b1144c 100755
--- a/Frontend Angular 4/src/app/layout/matefun/matefun.component.ts	
+++ b/Frontend Angular 4/src/app/layout/matefun/matefun.component.ts	
@@ -73,6 +73,7 @@ export class MateFunComponent {
     modificado = false;
     argumentoI = false;
     argumentoF = false;
+    hintsCheck = true;
     editableLoaded = false;
     editDialogFired = false;
     archivosTree :any;
@@ -233,7 +234,12 @@ export class MateFunComponent {
                 this.notifService.error(error);
                 this.popover.close();
             }
-            );
+        );
+        if (!this.hintsCheck){
+            delete this.configCodeMirror.extraKeys["Ctrl-Space"];
+        }else{
+            this.configCodeMirror.extraKeys["Ctrl-Space"] = "autocomplete";
+        }
     }
 
     aumentarFuente(){
@@ -418,7 +424,7 @@ export class MateFunComponent {
     }
 
     archivoModificado(event){
-        if (!event.ctrlKey && !event.altKey){
+        if (this.hintsCheck && !event.ctrlKey && !event.altKey){
             if (/^[\w\_\d]$/.test(event.key) || event.key == 'Enter')
                 this.codemirror.instance.showHint(event);
             if(this.copiaNombreArchivo!=this.archivo.nombre || this.copiaContenidoArchivo != this.archivo.contenido){
@@ -625,6 +631,4 @@ export class MateFunComponent {
             this.graph3DComp.onActivate();
         }
     }
-
-
 }
-- 
GitLab