Skip to content
This repository
Browse code

remove spell check for now

  • Loading branch information...
commit 4cd0f7dd04f0000d74914657b93801343ace5ddb 1 parent 6561d79
Jon Rose authored
7,418 img/sketchpad-logo.ai
0 additions, 7,418 deletions not shown
6 project.clj
@@ -5,14 +5,10 @@
5 5 :dependencies [[org.clojure/clojure "1.4.0"]
6 6 [seesaw "1.4.2"]
7 7 [clooj "0.3.4.2-SNAPSHOT"]
8   - [rounded-border "0.0.1-SNAPSHOT"]
9 8 [rsyntaxtextarea-clojars/rsyntaxtextarea-clojars "0.1.0-SNAPSHOT"]
10 9 [language-builder "1.0.0-SNAPSHOT"]
11 10 [auto-complete "0.1.0-SNAPSHOT"]
12 11 [leiningen "2.0.0-preview7"]
13   - [timbre "0.5.1-SNAPSHOT"]
14 12 [language-support/language-support "0.1.0-SNAPSHOT"]
15   - [rsta_spellchecker/rsta_spellchecker "0.1.0-SNAPSHOT"]
16   - [org.apache.commons/commons-io "1.3.2"]
17   - [quil/quil "1.6.0"]]
  13 + [rsta_spellchecker/rsta_spellchecker "0.1.0-SNAPSHOT"]]
18 14 :jvm-opts ~(if (= (System/getProperty "os.name") "Mac OS X") ["-Xdock:name=SketchPad"] []))
19 resources/default.clj
@@ -15,7 +15,7 @@
15 15 :font "MENLO-BOLD-12"
16 16 :tab-size 2
17 17 :hyper-links-enabled false
18   - :mark-occurences false
  18 + :mark-occurences true
19 19 :mark-occurences-color "#ADA6A9"
20 20 :paint-mark-occurences-border false
21 21 :matched-bracket-bg-color [80 240 70 50]
@@ -40,7 +40,7 @@
40 40 :font "MENLO-BOLD-12"
41 41 :tab-size 2
42 42 :hyper-links-enabled false
43   - :mark-occurences false
  43 + :mark-occurences true
44 44 :mark-occurences-color "#ADA6A9"
45 45 :paint-mark-occurences-border false
46 46 :matched-bracket-bg-color [80 240 70 50]
@@ -81,13 +81,13 @@
81 81 {})
82 82
83 83 (def default-gutter-prefs
84   - {:border-color [0 0 0 0]
85   - :bookmarking-enabled false
86   - :fold-indicator-enabled true ;; not functional until new Clojure Lexxer is integrated
87   - :line-number-color [143 144 134]
88   - :line-number-font "MENLO-12-BOLD"
89   - :line-number-start-index 1
90   - :active-range-color [50 50 41]})
  84 + {:border-color [0 0 0 0]
  85 + :bookmarking-enabled false
  86 + :fold-indicator-enabled true ;; not functional until new Clojure Lexxer is integrated
  87 + :line-number-color [143 144 134]
  88 + :line-number-font "MENLO-12-BOLD"
  89 + :line-number-start-index 1
  90 + :active-range-color [50 50 41]})
91 91
92 92 (def default-sketchpad-prefs
93 93 {:show-tabs? true})
@@ -159,3 +159,4 @@
159 159 :toggle-bookmark "meta F2"
160 160 :prev-occurrence "meta shift K"
161 161 :next-occurrence "meta K"})
  162 +
9 src/sketchpad/buffer/spell_check.clj
@@ -2,11 +2,12 @@
2 2 (:require [sketchpad.config.config :as config])
3 3 (:import (org.fife.ui.rsyntaxtextarea.spell SpellingParser)))
4 4
5   -; (defonce dic-resource (clojure.java.io/resource "english_dic.zip"))
  5 +(defonce dic-resource (clojure.java.io/resource "english_dic.zip"))
  6 +; (def dr (clojure.java.io/resource "english_dic.zip"))
6 7
7   -; (println dic-resource)
8   -; (println (type dic-resource))
9   -; (println (.getFile dic-resource))
  8 +(println dic-resource)
  9 +(println (type dic-resource))
  10 +(println (.getFile dic-resource))
10 11 ; (println (clojure.java.io/file dic-resource))
11 12
12 13
29 src/sketchpad/core.clj
@@ -19,6 +19,7 @@
19 19 [sketchpad.editor.editor :as sketchpad.editor]
20 20 [sketchpad.project.project :as project]
21 21 [sketchpad.menu.menu-bar :as menu]
  22 + [sketchpad.wrapper.rsyntaxtextarea :as rsyntaxtextarea]
22 23 [sketchpad.editor.info :as info]
23 24 [sketchpad.buffer.action :as buffer.action]
24 25 [sketchpad.repl.info :as repl.info]
@@ -34,6 +35,19 @@
34 35 false))
35 36 true)
36 37
  38 +; (defn check-buffers
  39 +; [e]
  40 +; (if (tabs?)
  41 +; (let [response (close-or-save-application-dialogue "Quit Application")]
  42 +; (cond
  43 +; (= response 0)
  44 +; (println 0)
  45 +; (= response 1)
  46 +; (println 1)
  47 +; (= response 2)
  48 +; (println 2)
  49 +; ))))
  50 +
37 51 (defn create-app
38 52 []
39 53 (let [buffer-info (info/buffer-info)
@@ -47,7 +61,7 @@
47 61 file-tree {:type :file-tree
48 62 :component (file-tree state/app)}
49 63
50   - repl-tabbed-panel (app.repl/repl-tabbed-panel)
  64 + repl-tabbed-panel (app.repl/repl-tabbed-panel)
51 65 repl-info (repl.info/repl-info)
52 66 repl-component (vertical-panel :items[(get-in repl-tabbed-panel [:component :container])
53 67 :fill-h
@@ -95,11 +109,12 @@
95 109 repl-tabbed-panel
96 110 repl-component
97 111 main-vertical-split-pane
98   - top-horizontal-split-panel))
99   - icon-url (clojure.java.io/resource "sketchpad-lambda-logo.png")
100   - icon (.createImage (Toolkit/getDefaultToolkit) icon-url)]
101   - (.setIconImage frame icon)
102   - (set-osx-icon icon)
  112 + top-horizontal-split-panel))]
  113 + (when (rsyntaxtextarea/is-osx?)
  114 + (let [icon-url (clojure.java.io/resource "sketchpad-lambda-logo.png")
  115 + icon (.createImage (Toolkit/getDefaultToolkit) icon-url)]
  116 + (.setIconImage frame icon)
  117 + (set-osx-icon icon)))
103 118 app))
104 119
105 120
@@ -118,7 +133,7 @@
118 133 (seq (.getURLs (java.lang.ClassLoader/getSystemClassLoader))))))
119 134
120 135 (defn init-projects []
121   - (project/add-project "tmp")
  136 + (project/add-project "sketchpad-tmp")
122 137 (doall (map #(project/add-project %) (load-project-set))))
123 138
124 139 ;; startup
2  src/sketchpad/editor/buffer.clj
@@ -114,7 +114,7 @@
114 114 (defn blank-clj-buffer!
115 115 ([] (blank-clj-buffer! nil))
116 116 ([parent-dir]
117   - (let [buffer (editor.build/scratch-buffer-tab "tmp")]
  117 + (let [buffer (editor.build/scratch-buffer-tab "sketchpad-tmp")]
118 118 (init-buffer-tab-state buffer)
119 119 (sketchpad.project/add-buffer-to-app buffer)
120 120 (tab/show-buffer buffer))))
6 src/sketchpad/editor/build.clj
@@ -15,7 +15,6 @@
15 15 [sketchpad.util.utils :as utils]
16 16 [sketchpad.project.project :as sketchpad.project]
17 17 [sketchpad.editor.component :as editor.component]
18   - [sketchpad.editor.quil-component :as editor.quil-component]
19 18 [sketchpad.editor.info-utils :as editor.info-utils]
20 19 [sketchpad.menu.view :as sketchpad.menu.view]
21 20 [sketchpad.file.file :as file]))
@@ -92,13 +91,16 @@
92 91 tab-state (get buffer-component :state)
93 92 uuid (.. UUID randomUUID toString)
94 93 buffer { :type :buffer
  94 +
95 95 :text-area text-area
96 96 :title (:title buffer-component)
97 97 :label (:label buffer-component)
98   - :file (atom nil)
99 98 :container container
  99 + :file (atom nil)
  100 +
100 101 :state tab-state
101 102 :new-file? (atom true)
  103 +
102 104 :component buffer-component
103 105 :project project-path
104 106 :uuid uuid}]
11 src/sketchpad/editor/editor.clj
@@ -4,14 +4,23 @@
4 4 [sketchpad.system.desktop])
5 5 (:require [sketchpad.editor.ui :as editor.ui]
6 6 [sketchpad.tree.popup :as popup]
  7 + [sketchpad.project.project :as sketchpad.project]
7 8 [sketchpad.editor.info-utils :as editor.info-utils]
8   - [sketchpad.state.state :as state])
  9 + [sketchpad.state.state :as state]
  10 + [sketchpad.util.tab :as tab])
9 11 (:import (javax.swing UIManager)))
10 12
11 13 (defn put [laf k v]
12 14 (.put laf (str "TabbedPane." k) v))
13 15
14 16 (defn tab-change-handler [buffer-tabbed-panel]
  17 +
  18 + ; (listen buffer-tabbed-panel :selection
  19 + ; (fn [e]
  20 + ; (let [buffer (tab/current-buffer)]
  21 + ; (if-let[buffer-project (sketchpad.project/project-by-name (:project buffer))]
  22 + ; (reset! (:last-active-buffer buffer-project) buffer)))))
  23 +
15 24 (listen buffer-tabbed-panel :selection editor.info-utils/update-doc-title-label!)
16 25 (listen buffer-tabbed-panel :selection editor.info-utils/update-doc-position-label!))
17 26
9 src/sketchpad/editor/info_utils.clj
@@ -2,6 +2,7 @@
2 2 (:use [seesaw core])
3 3 (:require [sketchpad.state.state :as state]
4 4 [sketchpad.util.tab :as tab]
  5 + [sketchpad.tree.utils :as tree.utils]
5 6 [sketchpad.state.state :as state]))
6 7
7 8 (defn format-position-str [line column]
@@ -29,8 +30,12 @@
29 30 "Update the currently displayed doc title in the info panel"
30 31 [e]
31 32 (if (tab/tabs?)
32   - (config! (:doc-title-label @state/app) :text (tab/title))
33   - (config! (:doc-title-label @state/app) :text "")))
  33 + (invoke-later
  34 + (config! (:doc-title-label @state/app) :text (tab/title))
  35 + (when @(:file (tab/current-buffer))
  36 + (tree.utils/set-tree-selection (.getAbsolutePath @(:file (tab/current-buffer))))))
  37 + (invoke-later
  38 + (config! (:doc-title-label @state/app) :text ""))))
34 39
35 40 (defn attach-caret-handler [text-area]
36 41 (listen text-area :caret-update update-doc-position-label!))
4 src/sketchpad/editor/tab.clj
@@ -55,10 +55,12 @@
55 55 (.setFocusable false))
56 56 button)))
57 57
  58 +
  59 +
58 60 (defn button-tab
59 61 [buffer]
60 62 (let [button (tab-button buffer)
61   - label (label :text @(:title buffer)
  63 + label (label :text @(get-in buffer [:component :title])
62 64 :foreground (color :white)
63 65 :focusable? false
64 66 :font (font/font "MENLO-12"))
8 src/sketchpad/menu/file.clj
@@ -44,8 +44,9 @@
44 44 (do
45 45 (when (file/save-file! buffer)
46 46 (tab/mark-current-tab-clean!))))
47   - (when (= @(:title buffer) "project.clj")
48   - (project/update-lein-project! (project/project-from-buffer buffer))))))
  47 + (when (= @(get-in buffer [:component :title]) "project.clj")
  48 + (project/update-lein-project! (project/project-from-buffer buffer)))
  49 + (tree.utils/update-tree))))
49 50
50 51 (defn save-as
51 52 "Open the save as dialog for the current buffer."
@@ -57,7 +58,8 @@
57 58 (when-let[new-file (file/save-file-as!)]
58 59 (when @(:new-file? buffer)
59 60 (reset! (:new-file? buffer) false)
60   - (reset! (:title buffer) (.getName new-file)))))))
  61 + (reset! (:title buffer) (.getName new-file))))
  62 + (tree.utils/update-tree))))
61 63
62 64 (defn new-project
63 65 "Create a new Leiningen project."
2  src/sketchpad/menu/project.clj
@@ -79,5 +79,5 @@
79 79 (seesaw/separator)
80 80 (seesaw.core/menu-item :text "Clear All Projects"
81 81 :mnemonic "C"
82   - :listen [:action (fn [_] (tree.utils/clear-projects))])]))
  82 + :listen [:action (fn [_] (clear-projects))])]))
83 83
40 src/sketchpad/menu/source.clj
... ... @@ -1,10 +1,12 @@
1 1 (ns sketchpad.menu.source
2   - (:require [seesaw.core :as seesaw]
3   - [seesaw.keystroke :as keystroke]
4   - [sketchpad.buffer.action :as buffer.action]
5   - [sketchpad.repl.print :as sketchpad.repl.print]
6   - [sketchpad.util.tab :as tab]
7   - [sketchpad.buffer.spell-check :as spell-check]))
  2 + (:use [clojure.java.shell])
  3 + (:require [seesaw.core :as seesaw]
  4 + [seesaw.keystroke :as keystroke]
  5 + [sketchpad.buffer.action :as buffer.action]
  6 + [sketchpad.repl.print :as sketchpad.repl.print]
  7 + [sketchpad.util.tab :as tab]
  8 + [sketchpad.buffer.spell-check :as spell-check]
  9 + [sketchpad.state.state :as state]))
8 10
9 11
10 12
@@ -46,6 +48,17 @@
46 48 (spell-check/remove-english-spell-checker text-area)
47 49 (.repaint text-area)))
48 50
  51 +(defn grep-files
  52 +"Grep the current projects or a given path."
  53 + ([search-term] (:out (apply sh "grep" "-nir" "-I" search-term (keys @(:projects @state/app)))))
  54 + ([search-term & opts]
  55 + (:out (apply sh "grep" "-nir" "-I" search-term opts))))
  56 +
  57 +(defn grep-cmd
  58 +"Focus the editor REPL and create a search function."
  59 +([]
  60 + (sketchpad.repl.print/append-command (str "(grep \"\")") -2)
  61 + (tab/focus-application-repl)))
49 62
50 63 (defn make-source-menu-items []
51 64 {:search (seesaw.core/menu-item :text "Search..."
@@ -71,7 +84,11 @@
71 84 :remove-spell-check (seesaw.core/menu-item :text "Remove Spell Checker"
72 85 :mnemonic "S"
73 86 :key (keystroke/keystroke "meta alt S")
74   - :listen [:action (fn [_] (remove-spell-check))])})
  87 + :listen [:action (fn [_] (remove-spell-check))])
  88 + :grep (seesaw.core/menu-item :text "Grep project or path..."
  89 + :mnemonic "G"
  90 + :key (keystroke/keystroke "meta G")
  91 + :listen [:action (fn [_] (grep-cmd))])})
75 92
76 93 (defn make-source-menu
77 94 []
@@ -83,7 +100,10 @@
83 100 (menu-items :search-replace)
84 101 (menu-items :search-replace-all)
85 102 (seesaw.core/separator)
86   - (menu-items :toggle-comment)
  103 + (menu-items :grep)
87 104 (seesaw.core/separator)
88   - (menu-items :add-spell-check)
89   - (menu-items :remove-spell-check)])))
  105 + (menu-items :toggle-comment)
  106 + ; (seesaw.core/separator)
  107 + ; (menu-items :add-spell-check)
  108 + ; (menu-items :remove-spell-check)
  109 + ])))
2  src/sketchpad/menu/view.clj
@@ -71,7 +71,7 @@
71 71 (if (@current-tab-state :clean)
72 72 (tab/close-tab) ;; nothing has changed, just close.
73 73 (do
74   - (let [answer (option-windows/close-or-save-current-dialogue @(:title buffer))]
  74 + (let [answer (option-windows/close-or-save-current-dialogue @(get-in buffer [:component :title]))]
75 75 (cond
76 76 (= answer 0) ;; answered yes to save
77 77 (do
4 src/sketchpad/project/form.clj
@@ -15,7 +15,7 @@
15 15 (defn project-creation-form
16 16 []
17 17 (let [project-path-str (str (.getAbsoluteFile (java.io.File. config/project-path)) "/")
18   - repo-text-area (rsyntax/text-area :columns 200
  18 + repo-text-area (rsyntax/text-area :columns 200
19 19 :id :project-form-dependencies
20 20 :listen [:component-resized re-pack!])
21 21 project-title (text :id :project-form-project)
@@ -36,7 +36,7 @@
36 36 (config! version-number :text "0.0.1-SNAPSHOT")
37 37 (config! project-path :text project-path-str)
38 38 (config! project-description :text "FIXME: write")
39   - (config! repo-text-area :text "[org.clojure/clojure \"1.3.0\"]\n")
  39 + (config! repo-text-area :text "[org.clojure/clojure \"1.4.0\"]\n")
40 40 (.setCaretPosition repo-text-area (.getLastVisibleOffset repo-text-area))
41 41 (install-clojars-auto-completions repo-text-area)
42 42 form))
5 src/sketchpad/project/project.clj
@@ -56,7 +56,9 @@
56 56 :id id
57 57 :theme theme
58 58 ; :completion-provider (auto-complete/build-project-completion-provider project-path)
59   - :repls (atom {})
  59 + :repls (atom {})
  60 + :last-focused-repl (atom nil)
  61 + :last-focused-buffer (atom nil)
60 62 :buffers (atom {})})))
61 63 (if (lein-project-file? project-path)
62 64 (try
@@ -80,6 +82,7 @@
80 82 (reset! (:project-set @state/app) (sorted-set)))
81 83
82 84 (defn clear-projects []
  85 + (clear-project-set)
83 86 (reset! (:projects @state/app) {}))
84 87
85 88 (defn setup-non-project-map []
4 src/sketchpad/repl/app/component.clj
@@ -8,7 +8,8 @@
8 8 [sketchpad.config.config :as config.config]
9 9 [sketchpad.buffer.action :as buffer.action]
10 10 [sketchpad.repl.app.sketchpad-repl :as app.sketchpad-repl])
11   - (:import (java.util.concurrent LinkedBlockingDeque)
  11 + (:import (java.util UUID)
  12 + (java.util.concurrent LinkedBlockingDeque)
12 13 (org.fife.ui.rtextarea RTextScrollPane)))
13 14
14 15 (defn- sketchpad-reader [q prompt exit]
@@ -52,6 +53,7 @@
52 53 :component {:container repl-container :text-area text-area :scroller repl-in-scroll-pane}
53 54 :title repl-title
54 55 :history repl-history
  56 + :uuid (.. UUID randomUUID toString)
55 57 :que repl-que
56 58 :tab tab}]
57 59 (meta/put-meta! text-area :repl-history repl-history)
37 src/sketchpad/repl/app/repl.clj
@@ -20,6 +20,7 @@
20 20 (:require [clojure.string :as string]
21 21 [sketchpad.rsyntax :as rsyntax]
22 22 [clojure.java.io :as io]
  23 + [sketchpad.project.project :as sketchpad.project]
23 24 [sketchpad.config.config :as config]
24 25 [sketchpad.buffer.action :as buffer.action]
25 26 [sketchpad.editor.ui :as editor.ui]
@@ -32,8 +33,7 @@
32 33 [sketchpad.repl.tab :as repl.tab]
33 34 [sketchpad.repl.app.component :as repl.app.component]
34 35 [leiningen.core.project :as lein])
35   - (:import
36   - (java.io.IOException)))
  36 + (:import (java.io.IOException)))
37 37
38 38 (use 'clojure.java.javadoc)
39 39
@@ -109,7 +109,7 @@
109 109
110 110 (defn update-repl-history [app]
111 111 (swap! (:items repl-history) replace-first
112   - (get-text-str (app :application-repl))))
  112 + (get-text-str (app :application-repl))))
113 113
114 114 (defn scroll-to-last [text-area]
115 115 (.scrollRectToVisible text-area
@@ -155,12 +155,28 @@
155 155 (attach-action-keys ta-in ["control UP" prev-hist]
156 156 ["control DOWN" next-hist])))
157 157
158   - (defn attach-tab-change-handler [repl-tabbed-panel]
159   - (listen repl-tabbed-panel :selection
160   - (fn [e]
161   - (let [num-tabs (tab-count repl-tabbed-panel)]
162   - (if (> 0 num-tabs)
163   - (swap! state/app assoc :doc-title-atom (current-editor-buffer repl-tabbed-panel)))))))
  158 +(defn update-last-repl
  159 + [e]
  160 + (when-let [repl (current-repl)]
  161 +
  162 + (println "REPL: ")
  163 + (println repl)
  164 +
  165 + (let [project (:project repl)]
  166 +
  167 + (println project)
  168 +
  169 + ; (reset!
  170 + ; (:last-focused-repl (sketchpad.project/get-project project)) repl)
  171 + )))
  172 +
  173 +(defn attach-tab-change-handler [repl-tabbed-panel]
  174 + (listen repl-tabbed-panel :selection update-last-repl)
  175 + (listen repl-tabbed-panel :selection
  176 + (fn [e]
  177 + (let [num-tabs (tab-count repl-tabbed-panel)]
  178 + (when (> 0 num-tabs)
  179 + (swap! state/app assoc :doc-title-atom (current-repl)))))))
164 180
165 181 (defn init-repl-tabbed-panel [repl-tabbed-panel repl]
166 182 (let [text-area (get-in repl [:component :text-area])
@@ -174,7 +190,7 @@
174 190 (auto-complete/install-auto-completion text-area)
175 191 (config! scroller :background config/app-color)
176 192 (config/apply-repl-prefs! text-area)
177   - (send-to-application-repl text-area "(require 'sketchpad.user)(in-ns 'sketchpad.user)")))
  193 + (send-to-application-repl text-area "(require 'sketchpad.user)\n(in-ns 'sketchpad.user)")))
178 194
179 195 (defn repl-tabbed-panel
180 196 []
@@ -192,3 +208,4 @@
192 208 :component {:container repl-tabbed-panel}
193 209 :application-repl application-repl}))
194 210
  211 +
2  src/sketchpad/repl/server.clj
@@ -50,8 +50,6 @@
50 50 (nrepl.ack/reset-ack-port!)
51 51 (let [prepped (promise)
52 52 project (:lein-project sketchpad-project)]
53   - (println "Creating repl server for lein project: ")
54   - (clojure.pprint/pprint project)
55 53 (.start
56 54 (Thread.
57 55 (bound-fn []
22 src/sketchpad/user.clj
@@ -8,13 +8,12 @@
8 8 [sketchpad.buffer.action]
9 9 [sketchpad.util.brackets]
10 10 [sketchpad.system.desktop]
11   - [sketchpad.auto-complete.template]
12   - [clojure.java.shell])
  11 + [sketchpad.auto-complete.template])
13 12 (:require [sketchpad.util.tab :as tab]
14 13 [sketchpad.wrapper.rsyntaxtextarea :as rsta]
15 14 [sketchpad.core :as core]
16   - ; [sketchpad.buffer.action :as buffer]
17 15 [sketchpad.wrapper.gutter :as gutter]
  16 + [sketchpad.menu.source :as source]
18 17 [sketchpad.buffer.search :as search]
19 18 [sketchpad.project.project :as project]
20 19 [sketchpad.project.form :as project.form]
@@ -313,6 +312,11 @@
313 312 []
314 313 (tab/current-buffer))
315 314
  315 +(defn current-repl
  316 +"Returns the map of the current project repl if one is open."
  317 + []
  318 + (tab/current-repl))
  319 +
316 320 (defn current-text-area []
317 321 "Returns the current text area."
318 322 (get-in (current-buffer) [:component :text-area]))
@@ -395,13 +399,7 @@
395 399 cur-token (org.fife.ui.rsyntaxtextarea.RSyntaxUtilities/getTokenAtOffset token dot)]
396 400 cur-token))
397 401
398   -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
399   -;;; Grep
400   -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
401   -
402 402 (defn grep
403   -"Grep a path."
404   - ([search-term] (grep search-term "projects/"))
405   - ([search-term path]
406   - (doall
407   - (apply println (clojure.string/split (:out (sh "grep" "-nri" search-term path)) #"\n")))))
  403 +"Grep the current projects or a given the given paths."
  404 + ([search-term] (source/grep-files search-term))
  405 + ([search-term & args] (source/grep-files search-term args)))
8 src/sketchpad/util/option_windows.clj
@@ -15,6 +15,14 @@
15 15 JOptionPane/YES_NO_CANCEL_OPTION)]
16 16 answer))
17 17
  18 +(defn close-or-save-application-dialogue [title]
  19 + (when-let [answer (JOptionPane/showConfirmDialog
  20 + nil
  21 + (str "Do you want to save the open buffers?" title)
  22 + "Unsaved Changes"
  23 + JOptionPane/YES_NO_CANCEL_OPTION)]
  24 + answer))
  25 +
18 26 (defn close-repl-dialogue []
19 27 (when-let [answer (JOptionPane/showConfirmDialog
20 28 nil
8 src/sketchpad/util/tab.clj
@@ -279,7 +279,7 @@
279 279 (focus (get-in buffer [:component :text-area]))))
280 280
281 281 (defn add-buffer [buffer]
282   - (add-tab! @(:title buffer) (:container buffer)))
  282 + (add-tab! @(get-in buffer [:component :title]) (:container buffer)))
283 283
284 284 (defn buffer-tab-component! [buffer]
285 285 (.setTabComponentAt (get-in (:buffer-tabbed-panel @state/app) [:component :container]) (index-of-buffer buffer) (get-in buffer [:tab :container])))
@@ -319,7 +319,11 @@
319 319 (get-meta (current-repl-text-area) :uuid))
320 320
321 321 (defn current-repl []
322   - (first (filter #(= (get-repl-uuid) (:uuid %)) (mapcat :repls @(:projects @state/app)))))
  322 + (mapcat :repls (vals @(:projects @state/app))))
  323 +
  324 +(defn current-repl
  325 + []
  326 + (second (mapcat #(deref (:repls %)) (vals @(:projects @state/app)))))
323 327
324 328 (defn current-buffer
325 329 ([]

0 comments on commit 4cd0f7d

Please sign in to comment.
Something went wrong with that request. Please try again.