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 CBD1022FCB for ; Mon, 28 Oct 2024 23:50:29 +0100 (CET) Received: from fhigh-b1-smtp.messagingengine.com ([202.12.124.152]) by 9front; Mon Oct 28 18:49:23 -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 D884C2540148 for <9front@9front.org>; Mon, 28 Oct 2024 18:49:21 -0400 (EDT) Received: from phl-imap-05 ([10.202.2.95]) by phl-compute-07.internal (MEProxy); Mon, 28 Oct 2024 18:49:21 -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=1730155761; x=1730242161; bh=L/9yk/pLX5XGk6PdyFSY2mUTQVf02HMCwJiDwhCKlYk=; b= OiFz1HaVEXJj16OUMnFkBm/QWj4Cq4zSq/c7ew43XwUuEUOSCvFBdmqE3rYDEf0T EypM23E+S+eVbiwLE7kgebxCQBayRNAj6FAaKbzIzoGz7knB9dKGxoVJ2iYhOl3Z ZmlbaVWXeahH4TV4sgOgeiMYZPyL9zjD5AayId5Q+ZKT6ncQmoO4nDBC/F54Tn4N i93YuOli+J6HXKd5RKBuJGMzeu1giG0zldFW0d7JE49V/TSbJuEW548p3Yo12SkJ PnjSFMCz61rf+Z8Bqv1TP/SMeVuWre8vO8MgE4v3QC1AFbgYQUGlGiOj1zxE269w f7XSba6j3wqH8mkavWTKSw== 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=1730155761; x= 1730242161; bh=L/9yk/pLX5XGk6PdyFSY2mUTQVf02HMCwJiDwhCKlYk=; b=L Kj1dENtKtbrXRV/93gudWVtN/JQMaIXZqfrY6FofAKVgwOvf0Ch7v+Ekv7NGNmQ6 ymP4PnxNQQxTA4IqMcGaLhS7UrQ1j+unesz0wQd826Vkw7bN7uH4M1VkY1v1Ubh2 ZmtBdwAF8ctqsiZaS8IfI9ty+0xNRQdibDGv/0Q6DmMDIHBt2dzSvs/UIr2rh9bo mauwEjfeXKI3UmRE3V7rRx2A4sM0vXBRNrvjb/yp6FPgorSSAVN5XT9N9TTdXsE5 KpTfx85nS+hXUy9JIlTwI2i8pCaauECNbJaE2MRgjopPdXO7UgdEPZqiwAWaCeQb fQJKXMFTEDtlR0mSSwJ0g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdektddgtddvucetufdoteggodetrfdotf 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 5C5C13020083; Mon, 28 Oct 2024 18:49:21 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 Date: Mon, 28 Oct 2024 16:49:00 -0600 From: "Scott Flowers" To: 9front@9front.org Message-Id: In-Reply-To: <588564A0F1AB6824ED04551648A54C37@cranky.ca> References: <588564A0F1AB6824ED04551648A54C37@cranky.ca> Content-Type: text/plain Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: immutable extension-aware JSON over YAML event cloud reduce/map shader Subject: Re: [9front] Bug or inconsistency in cursor behaviour? Reply-To: 9front@9front.org Precedence: bulk If interested, patch for acme, patch for rio below. Apologies for my non-c-programmerness. 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; 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: Scott On Mon, 28 Oct 2024, at 14:19, flowerss@cranky.ca wrote: > I have noticed an odd behaviour when using the arrow keys when text is selected in 9front, and I'm wondering if it's a bug, multiple bugs, or just the way things work. > > If I have a string of text in a shell or acme, and I select one or more characters with the mouse, and then use the right arrow key, the text gets deselected, and the cursor moves one character past the right end of the selected text. If I use the left arrow key, the cursor moves to one character to the left of the previously selected text. It feels like the resultin position of the cursor has gone one character too far left or right. > > In sam, this behaviour is different. If I select text in sam, and then hit the left arrow key, the cursor moves one character to the left of the initially selected text, and if I hit the right arrow key, the cursor moves to the right of the first character of the previously selected text. This also seems odd. > > In Windows, MacOS and all the Linux graphical text manipulation apps I have tried, if you select text and then hit the left arrow, the cursor moves to the beginning of the selection, and the right arrow moves to the end of the selection. This feels like the more appropriate behaviour to me. Am I out to lunch? > > Thanks, > > Scott >