From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <9front-bounces@9front.inri.net> X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: from 9front.inri.net (9front.inri.net [168.235.81.73]) by inbox.vuxu.org (Postfix) with ESMTP id E54802FCE8 for ; Tue, 29 Oct 2024 00:06:35 +0100 (CET) Received: from fhigh-b1-smtp.messagingengine.com ([202.12.124.152]) by 9front; Mon Oct 28 19:05:08 -0400 2024 Received: from phl-compute-07.internal (phl-compute-07.phl.internal [10.202.2.47]) by mailfhigh.stl.internal (Postfix) with ESMTP id 3B7D5254013B for <9front@9front.org>; Mon, 28 Oct 2024 19:05:07 -0400 (EDT) Received: from phl-imap-05 ([10.202.2.95]) by phl-compute-07.internal (MEProxy); Mon, 28 Oct 2024 19:05:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cranky.ca; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1730156707; x=1730243107; bh=BWOyW0dx5Soraf6B19p0KM7ajhMPAXW9RPP0SWkQGbc=; b= aVmE734zS7270cCTK1HXQBxIUGmwcSCxaCMn9rKyBTHzr2+/Wqo65QUs9F/DomN6 ELwwf1cG2+AYh0KruNJnRfXQmyWE0k1jMiKCr8o2ekIeG2S/3OQREELrsDYYvYo6 rGqjv3Fn2Cc2UAAWbUwZx9bgcdjDFMe2OO8wws/G6/yUdpmmzkVWV1oUqYo+Yj+g hjdnqrDxWggtGHbIrgMNhpkbh56J+rXz8uOTwhxQUUaNoTa5iVM8k18XnLvxQjU0 leDOw+nyw5L1trsDmgNW3JBwiIOV68pcUG6DMV0KuRIOKjUM4QMEs3Z2xTwKErBD Qj7ryluyaj4HtR1hUIZqRA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1730156707; x= 1730243107; bh=BWOyW0dx5Soraf6B19p0KM7ajhMPAXW9RPP0SWkQGbc=; b=n H0rtOTMCQCX2YbsDwTEmXX9ECrNCBT0SnWVqRXO+4yOD3DhgJlv62H6kcYrTHqmG s8wU+q2d72klN3gTmxPYlkF8v6ma44vtrCrAopGRae44DwnZLk5TUCIU0RJ48/zs HDqz9Xm/LmO6PaFOhWgnSA4GglONbzDO3DxAN9LuZxkIe+79HLiZKov2IvG4wOUq rlwr8NDDSSMMfekF6RuxZUYfTURuxwSTbucbAigSOfZKIizfixTMiAUKR6ptSS30 DT1+77U0mCj8KYXFGI/tOLhKNMcnEU6ITpVjk9+TzBGm5XagEqzc1b/CkZu6iP5c CspsReC2PyhBINOLbyzFQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdektddgtdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefoggffhf fvkfgjfhfutgfgsehtjeertdertddtnecuhfhrohhmpedfufgtohhtthcuhfhlohifvghr shdfuceofhhlohifvghrshhssegtrhgrnhhkhidrtggrqeenucggtffrrghtthgvrhhnpe duhfegtedvjeetteeffefhieetveejveeigfejveelffffgeeuveetvddvjeeuueenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehflhhofigvrh hsshestghrrghnkhihrdgtrgdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtphho uhhtpdhrtghpthhtoheplehfrhhonhhtseelfhhrohhnthdrohhrgh X-ME-Proxy: Feedback-ID: i1e6c46d8:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id CC3953020080; Mon, 28 Oct 2024 19:05:06 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 Date: Mon, 28 Oct 2024 17:04:46 -0600 From: "Scott Flowers" To: 9front@9front.org Message-Id: In-Reply-To: References: <588564A0F1AB6824ED04551648A54C37@cranky.ca> Content-Type: text/plain Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: grid self-signing component solution Subject: Re: [9front] Bug or inconsistency in cursor behaviour? Reply-To: 9front@9front.org Precedence: bulk Actually, ignore that recommendation to ignore that patch. I panicked. I chalk it up to first-patch-submission jitters. Below will make acme and rio left and right arrow keys move the cursor to the beginning and end of selected text respectively, instead of one extra character left or right. diff 6894c4e13a24e9983e2daf4ee2566f8396d29f4e uncommitted --- a/sys/src/cmd/rio/wind.c +++ b/sys/src/cmd/rio/wind.c @@ -892,16 +892,30 @@ return; case Kleft: if(w->q0 > 0){ - q0 = w->q0-1; - wsetselect(w, q0, q0); - wshow(w, q0); + if(w->q1 != w->q0) { + q0 = w->q0; + wsetselect(w, q0, q0); + wshow(w, q0); + } + else { + q0 = w->q0-1; + wsetselect(w, q0, q0); + wshow(w, q0); + } } return; case Kright: if(w->q1 < w->nr){ - q1 = w->q1+1; - wsetselect(w, q1, q1); - wshow(w, q1); + if(w->q1 != w->q0) { + q1 = w->q1; + wsetselect(w, q1, q1); + wshow(w, q1); + } + else { + q1 = w->q1+1; + wsetselect(w, q1, q1); + wshow(w, q1); + } } return; case Khome: diff 6894c4e13a24e9983e2daf4ee2566f8396d29f4e uncommitted --- a/sys/src/cmd/acme/text.c +++ b/sys/src/cmd/acme/text.c @@ -680,13 +680,24 @@ switch(r){ case Kleft: typecommit(t); - if(t->q0 > 0) - textshow(t, t->q0-1, t->q0-1, TRUE); + if(t->q0 > 0) { + if(t->q0 != t->q1) { + textshow(t, t->q0, t->q0, TRUE); + } + else { + textshow(t, t->q0-1, t->q0-1, TRUE); + } + } return; case Kright: typecommit(t); if(t->q1 < t->file->nc) - textshow(t, t->q1+1, t->q1+1, TRUE); + if(t->q0 != t->q1) { + textshow(t, t->q1, t->q1, TRUE); + } + else { + textshow(t, t->q1+1, t->q1+1, TRUE); + } return; case Kdown: n = t->maxlines/3; Thanks, Scott