Skip to content

Commit f04feee

Browse files
authored
Merge pull request #55 from xavierr/fix_emacsrunregion
fix in emacsrunregion regarding call to regexp
2 parents 2fff242 + 6f16c84 commit f04feee

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

toolbox/emacsrunregion.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ function emacsrunregion(file, startchar, endchar)
4444

4545
% See if startchar and endchar are on the first column of a lines and if so display that. Note,
4646
% fileContents can contain POSIX newlines (LF) or be Windows CRFL (13, 10) line endings.
47-
if (startchar == 1 || fileContents(startchar-1) == newline) && ...
48-
regexp(fileContents(endchar), '[\r\n]', 'once')
47+
if (startchar == 1 || fileContents(startchar-1) == newline) && ~isempty(regexp(fileContents(endchar), '[\r\n]', 'once'))
4948
startLineNum = length(strfind(fileContents(1:startchar), newline)) + 1;
5049
endLineNum = length(strfind(fileContents(1:endchar), newline));
5150
if fileContents(endchar) == 13 || endchar == length(fileContents)

0 commit comments

Comments
 (0)