@@ -150,14 +150,20 @@ prevent switching to the new buffer once created."
150
150
(replace-regexp-in-string " \0 33\\ [[0-9]+[GKJ]" " " output))))
151
151
(setenv " NODE_NO_READLINE" " 1" )))
152
152
153
+ ;;;### autoload
154
+ (defun ts-send-string (text )
155
+ " Send `TEXT' to the inferior Typescript process."
156
+ (interactive " r" )
157
+ (run-ts ts-comint-program-command t )
158
+ (comint-send-string (get-buffer-process ts-comint-buffer)
159
+ (concat text " \n " )))
160
+
153
161
;;;### autoload
154
162
(defun ts-send-region (start end )
155
163
" Send the current region to the inferior Typescript process."
156
164
(interactive " r" )
157
165
(let ((text (buffer-substring-no-properties start end)))
158
- (run-ts ts-comint-program-command t )
159
- (comint-send-string (get-buffer-process ts-comint-buffer)
160
- (concat text " \n " ))))
166
+ (ts-send-string text)))
161
167
162
168
;;;### autoload
163
169
(defun ts-send-region-and-go (start end )
@@ -206,17 +212,14 @@ prevent switching to the new buffer once created."
206
212
" Load file `FILENAME' in the Typescript interpreter."
207
213
(interactive " f" )
208
214
(let ((filename (expand-file-name filename)))
209
- (run-ts ts-comint-program-command t )
210
- (comint-send-string ts-comint-buffer (ts--get-load-file-cmd filename))))
215
+ (ts-send-string (ts--get-load-file-cmd filename))))
211
216
212
217
;;;### autoload
213
218
(defun ts-load-file-and-go (filename )
214
219
" Load file `FILENAME' in the Typescript interpreter."
215
220
(interactive " f" )
216
- (let ((filename (expand-file-name filename)))
217
- (run-ts ts-comint-program-command t )
218
- (comint-send-string ts-comint-buffer (ts--get-load-file-cmd filename))
219
- (switch-to-ts ts-comint-buffer)))
221
+ (ts-load-file filename)
222
+ (switch-to-ts ts-comint-buffer))
220
223
221
224
;;;### autoload
222
225
(defun switch-to-ts (eob-p )
0 commit comments