@@ -175,6 +175,15 @@ The object with following attributes:
175
175
" LeetCode programming language or sql for current problem internally.
176
176
Default is programming language." )
177
177
178
+ (defvar leetcode--description-window nil
179
+ " (Internal) Holds the reference to description window." )
180
+
181
+ (defvar leetcode--testcase-window nil
182
+ " (Internal) Holds the reference to testcase window." )
183
+
184
+ (defvar leetcode--result-window nil
185
+ " (Internal) Holds the reference to result window." )
186
+
178
187
(defconst leetcode--lang-suffixes
179
188
'((" c" . " .c" ) (" cpp" . " .cpp" ) (" csharp" . " .cs" )
180
189
(" golang" . " .go" ) (" java" . " .java" ) (" javascript" . " .js" )
@@ -879,11 +888,11 @@ LeetCode require slug-title as the request parameters."
879
888
| | Result |
880
889
+---------------+----------------+"
881
890
(delete-other-windows )
882
- (split-window-horizontally )
891
+ (setq leetcode--description-window ( split-window-horizontally ) )
883
892
(other-window 1 )
884
- (split-window-below )
893
+ (setq leetcode--testcase-window ( split-window-below ) )
885
894
(other-window 1 )
886
- (split-window-below )
895
+ (setq leetcode--result-window ( split-window-below ) )
887
896
(other-window -1 )
888
897
(other-window -1 ))
889
898
@@ -1273,16 +1282,10 @@ major mode by `leetcode-prefer-language'and `auto-mode-alist'."
1273
1282
(with-current-buffer (get-buffer-create testcase-buf-name)
1274
1283
(erase-buffer )
1275
1284
(insert testcase)
1276
- (display-buffer (current-buffer )
1277
- '((display-buffer-reuse-window
1278
- leetcode--display-testcase)
1279
- (reusable-frames . visible))))
1285
+ (set-window-buffer leetcode--testcase-window (current-buffer )))
1280
1286
(with-current-buffer (get-buffer-create result-buf-name)
1281
1287
(erase-buffer )
1282
- (display-buffer (current-buffer )
1283
- '((display-buffer-reuse-window
1284
- leetcode--display-result)
1285
- (reusable-frames . visible)))))))
1288
+ (set-window-buffer leetcode--result-window (current-buffer ))))))
1286
1289
1287
1290
(aio-defun leetcode-restore-layout ()
1288
1291
" This command should be run in LeetCode code buffer.
0 commit comments