From f58452e3ae7ed595566028010128c99e3afb572b Mon Sep 17 00:00:00 2001 From: kobarity Date: Sun, 1 Jan 2023 21:09:10 +0900 Subject: Fix 'python-shell-buffer-substring' when START is in middle of 1st line * lisp/progmodes/python.el (python-shell-buffer-substring): Instead of checking whether START is point-min, check whether START is in the first line. (Bug#60466) * test/lisp/progmodes/python-tests.el (python-shell-buffer-substring-18): New test. --- test/lisp/progmodes/python-tests.el | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/lisp/progmodes/python-tests.el') diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index eac558db10f..df71990278e 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el @@ -4520,6 +4520,16 @@ def foo(): (python-tests-look-at "\"\"\"")) "# -*- coding: utf-8 -*-\n\nif True:\n a = 1\n b = 2\n\n")))) +(ert-deftest python-shell-buffer-substring-18 () + "Check substring from the part of the first line." + (python-tests-with-temp-buffer + "s = 'test' +" + (should (string= (python-shell-buffer-substring + (python-tests-look-at "'test'") + (pos-eol)) + "'test'")))) + ;;; Shell completion -- cgit v1.2.1