mirror of
				https://github.com/janet-lang/janet
				synced 2025-10-31 15:43:01 +00:00 
			
		
		
		
	Simplify and don't replace history for cancelled forms
This commit is contained in:
		| @@ -63,8 +63,7 @@ Janet janet_line_getter(int32_t argc, Janet *argv) { | |||||||
|         gbl_cancel_current_repl_form = false; |         gbl_cancel_current_repl_form = false; | ||||||
|  |  | ||||||
|         // Signal that the user bailed out of the current form |         // Signal that the user bailed out of the current form | ||||||
|         static const char *const msg = "cancel"; |         result = janet_ckeywordv("cancel"); | ||||||
|         result = janet_ckeywordv(msg); |  | ||||||
|     } else { |     } else { | ||||||
|         result = janet_wrap_buffer(buf); |         result = janet_wrap_buffer(buf); | ||||||
|     } |     } | ||||||
| @@ -960,16 +959,12 @@ void janet_line_get(const char *p, JanetBuffer *buffer) { | |||||||
|     } |     } | ||||||
|     if (line()) { |     if (line()) { | ||||||
|         norawmode(); |         norawmode(); | ||||||
|         if (gbl_cancel_current_repl_form) { |         if (gbl_sigint_flag) { | ||||||
|             fputc('\n', out); |             raise(SIGINT); | ||||||
|         } else { |         } else { | ||||||
|             if (gbl_sigint_flag) { |             fputc('\n', out); | ||||||
|                 raise(SIGINT); |  | ||||||
|             } else { |  | ||||||
|                 fputc('\n', out); |  | ||||||
|             } |  | ||||||
|             return; |  | ||||||
|         } |         } | ||||||
|  |         return; | ||||||
|     } |     } | ||||||
|     fflush(stdin); |     fflush(stdin); | ||||||
|     norawmode(); |     norawmode(); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 LouisJackman
					LouisJackman