From 6f16c847365fad5c5adae0f818cc5d1409136dbb Mon Sep 17 00:00:00 2001 From: Xavier Raynaud Date: Tue, 12 Aug 2025 16:56:37 +0200 Subject: [PATCH] fix in emacsrunregion regarding call to regexp --- toolbox/emacsrunregion.m | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/toolbox/emacsrunregion.m b/toolbox/emacsrunregion.m index 5517cd8..8153df4 100644 --- a/toolbox/emacsrunregion.m +++ b/toolbox/emacsrunregion.m @@ -44,8 +44,7 @@ function emacsrunregion(file, startchar, endchar) % See if startchar and endchar are on the first column of a lines and if so display that. Note, % fileContents can contain POSIX newlines (LF) or be Windows CRFL (13, 10) line endings. - if (startchar == 1 || fileContents(startchar-1) == newline) && ... - regexp(fileContents(endchar), '[\r\n]', 'once') + if (startchar == 1 || fileContents(startchar-1) == newline) && ~isempty(regexp(fileContents(endchar), '[\r\n]', 'once')) startLineNum = length(strfind(fileContents(1:startchar), newline)) + 1; endLineNum = length(strfind(fileContents(1:endchar), newline)); if fileContents(endchar) == 13 || endchar == length(fileContents)