]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/cmd/acme/text.c
acme: import changes from plan9port (thanks jxy)
[plan9front.git] / sys / src / cmd / acme / text.c
index ebbc5dcfd53fc46593c3788e2bb2887012783b0a..484ec3de12d1e829f785503911e767b3e1b8e4e4 100644 (file)
@@ -1411,7 +1411,7 @@ textsetorigin(Text *t, uint org, int exact)
        Rune *r;
        uint n;
 
-       if(org>0 && !exact){
+       if(org>0 && !exact && textreadc(t, org-1) != '\n'){
                /* org is an estimate of the char posn; find a newline */
                /* don't try harder than 256 chars */
                for(i=0; i<256 && org<t->file->nc; i++){