qemacs-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemacs-commit] qemacs qe.c shell.c


From: Charlie Gordon
Subject: [Qemacs-commit] qemacs qe.c shell.c
Date: Wed, 12 Apr 2017 03:54:30 -0400 (EDT)

CVSROOT:        /sources/qemacs
Module name:    qemacs
Changes by:     Charlie Gordon <chqrlie>        17/04/12 03:54:30

Modified files:
        .              : qe.c shell.c 

Log message:
        display: fix some popup issues
        - prevent some commands from a popup-window or close it

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/qe.c?cvsroot=qemacs&r1=1.263&r2=1.264
http://cvs.savannah.gnu.org/viewcvs/qemacs/shell.c?cvsroot=qemacs&r1=1.123&r2=1.124

Patches:
Index: qe.c
===================================================================
RCS file: /sources/qemacs/qemacs/qe.c,v
retrieving revision 1.263
retrieving revision 1.264
diff -u -b -r1.263 -r1.264
--- qe.c        12 Apr 2017 07:33:20 -0000      1.263
+++ qe.c        12 Apr 2017 07:54:30 -0000      1.264
@@ -6205,7 +6205,8 @@
 {
     QEmacsState *qs = s->qe_state;
 
-    /* XXX: only do this for a popup? */
+    if (s->flags & WF_POPUP) {
+        /* only do this for a popup? */
     s->b->flags |= BF_TRANSIENT;
     edit_close(&s);
 
@@ -6213,6 +6214,7 @@
     popup_saved_active = NULL;
 
     do_refresh(qs->active_window);
+    }
 }
 
 /* show a popup on a readonly buffer */
@@ -6642,10 +6644,24 @@
 }
 
 static EditState *qe_find_target_window(EditState *s, int activate) {
+    EditState *e;
+
     /* Find the target window for some commands run from the dired window */
+    if (s->flags & WF_POPUP) {
+        e = check_window(&popup_saved_active);
+        popup_saved_active = NULL;
+        if (e) {
+            if (activate && s->qe_state->active_window == s)
+                s->qe_state->active_window = e;
+        }
+        s->b->flags |= BF_TRANSIENT;
+        edit_close(&s);
+        s = e;
+        do_refresh(s);
+    }
 #ifndef CONFIG_TINY
     if ((s->flags & WF_POPLEFT) && s->x1 == 0) {
-        EditState *e = find_window(s, KEY_RIGHT, NULL);
+        e = find_window(s, KEY_RIGHT, NULL);
         if (e) {
             if (activate && s->qe_state->active_window == s)
                 s->qe_state->active_window = e;
@@ -6663,6 +6679,9 @@
  */
 void do_set_next_mode(EditState *s, int dir)
 {
+    if (s->flags & WF_POPUP)
+        return;
+
     /* next-mode from the dired window applies to the target window */
     s = qe_find_target_window(s, 0);
     qe_set_next_mode(s, dir, 1);
@@ -6719,6 +6738,19 @@
     EOLType eol_type = EOL_UNIX;
     QECharset *charset = &charset_utf8;
 
+#ifndef CONFIG_TINY
+    /* when exploring from a popleft dired buffer, load a directory or
+     * file pattern into the same pane, but load a regular file into the view 
pane
+     */
+    if ((s->flags & WF_POPUP)
+    ||  (!is_directory(filename) && !is_filepattern(filename))) {
+        s = qe_find_target_window(s, 1);
+    }
+#endif
+
+    if (s->flags & WF_POPUP)
+        return - 1;
+
     if (lflags & LF_SPLIT_WINDOW) {
         /* Split window if window large enough and not empty */
         /* XXX: should check s->height units */
@@ -6739,15 +6771,6 @@
                                    filename, sizeof(filename), filename1);
     }
 
-#ifndef CONFIG_TINY
-    /* when exploring from a popleft dired buffer, load a directory or
-     * file pattern into the same pane, but load a regular file into the view 
pane
-     */
-    if (!is_directory(filename) && !is_filepattern(filename)) {
-        s = qe_find_target_window(s, 1);
-    }
-#endif
-
     /* If file already loaded in existing buffer, switch to that */
     b = eb_find_file(filename);
     if (b != NULL) {

Index: shell.c
===================================================================
RCS file: /sources/qemacs/qemacs/shell.c,v
retrieving revision 1.123
retrieving revision 1.124
diff -u -b -r1.123 -r1.124
--- shell.c     12 Apr 2017 07:33:20 -0000      1.123
+++ shell.c     12 Apr 2017 07:54:30 -0000      1.124
@@ -1668,6 +1668,9 @@
     ShellState *shs;
     EditBuffer *b = NULL;
 
+    if (s->flags & WF_POPUP)
+        return;
+
     if (s->flags & WF_POPLEFT) {
         /* avoid messing with the dired pane */
         s = find_window(s, KEY_RIGHT, s);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]