Fazlul Shahriar avatar Fazlul Shahriar committed 3116301

add some helpful comments

Comments (0)

Files changed (1)

 	err := initWindow()
 	if err != nil {
 		fmt.Fprintf(os.Stderr, err.String())
-		return 
+		return
 	}
 
 	for word := range events() {
 		os.Exit(1)
 	}
 	w.Write("data", []byte(""))
-	
+
 	// restart from ..
 	root = path.Clean(root + "/../")
 	title := "xplor-" + root
 	}
 	depth, line := getDepth(b)
 	fullpath := path.Join(root, getParents(charaddr, depth, 1), line)
-	fmt.Fprintf(os.Stdout, fullpath + "\n")
+	fmt.Fprintf(os.Stdout, fullpath+"\n")
 }
 
 func events() <-chan string {
 	go func() {
 		for e := range w.EventChan() {
 			switch e.C2 {
-			case 'x': // execute
+			case 'x': // execute in body
 				switch string(e.Text) {
-				case "Del": 
+				case "Del":
 					w.Ctl("delete")
 				case "DotDot":
-					msg := "DotDot"
-					c <- msg
+					c <- "DotDot"
 				default:
 					w.WriteEvent(e)
 				}
-			case 'X':
-				msg := "X" + fmt.Sprint(e.OrigQ0)
-				c <- msg
-			case 'l': // in the tag, let the plumber deal with it
+			case 'X': // execute in tag
+				c <- ("X" + fmt.Sprint(e.OrigQ0))
+			case 'l': // button 3 in tag
+				// let the plumber deal with it
 				w.WriteEvent(e)
-			case 'L': // look
+			case 'L': // button 3 in body
 				w.Ctl("clean")
 				//ignore expansions
 				if e.OrigQ0 != e.OrigQ1 {
 					continue
 				}
-				msg := fmt.Sprint(e.OrigQ0)
-				c <- msg
+				c <- fmt.Sprint(e.OrigQ0)
 			}
 		}
 		w.CloseFiles()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.