branch: externals/matlab-mode
commit f04feee7f66d938f6bc8093954f6f969eaf48b89
Merge: 2fff242dd3 6f16c84736
Author: John Ciolfi <john.ciolfi...@gmail.com>
Commit: GitHub <nore...@github.com>

    Merge pull request #55 from xavierr/fix_emacsrunregion
    
    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 17b61377d5..d37ef534e6 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)

Reply via email to