From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 10292 invoked from network); 10 Nov 2022 18:26:03 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 10 Nov 2022 18:26:03 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1668104763; b=YOLfCzhIupGK/8DJBmEp8GKxBOH3JjAUDl1JpVv9PV/PeJZrOFTvLTFIsNGn/JXqGyqDPO0oxe 8Cc+WJ+f6R0gB7pPyibl6qj+FCHKSfk/7wJ+n4NNfgyYWOJ4WzX3hTTanIrMPpuj1R4uce7E3K 78sWPFyfiUcT+1kJx1yEH0ffwDy8mSiTmqqlF2KQi/7L2jZ2499uM08p8TQsAYap54tH7wlxW7 oUPTr8T3K6M964Dfm8TfQtNRDXRCocxeLPZSWbAx0wvjgsZ7PEROjY5Ak9wEL5GTDnHBkEhSB6 tuJjHmu4o+DNpvHVT82uG/7omJ/8cjQrcbGeNBR7NEAaTg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta04.eastlink.ca) smtp.remote-ip=24.224.136.10; dmarc=none header.from=eastlink.ca; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1668104763; bh=Vfv66z8ft76dzc7kWXi5p63EIt7HozxHSnrBvj0zoiE=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:To:Subject:MIME-Version:Date:Message-ID:DKIM-Signature; b=bb8eoka9MZRveqLlzbcMDyeUEvMAbKY621wWGBSMvMQ+rvoi4Y7yPfPMALzDNXxVT3QqagB6ea FcibPyDkagISTn2VO1VSFWBu25qjyu4H18c8TY8m3f7Dx28CkwN3MqJsag4Po4wOzKUjSmtIsT tFHeLXNkgp4eJglsK+A4djmDRLUw7TCcMwYz0T5hUy6xf+RafgDX5FWmMDm0JQtx0OxWbMJa0V UyP7oTo66N8KOf6IoiI7VjyYqz9CMuXq+lnzCCbxtRJS1bkigFtR2mH+5bFz50Yog5IDIbJaW0 z0PTdgGtNXC8c/PhZvQhjDLPZ7EUWSRQXOYWDmV/5SsMxA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-transfer-encoding: Content-type:In-reply-to:From:References:To:Subject:MIME-version:Date: Message-id:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=oE2KqK8xqtCzPLl6vUdSAyxchMXVJ9/6pc5BPqYGItI=; b=R7cTTTuOUWPVtKqxbjRuI2vc/W g3gR0rVB7DkL4wMFiDTm6dkuJXOnYKfVWkY5R85sorkGjk+r5OZphVCV0X+4IQTwwowXALQELtvaf meUiLGXo3YCFkgzNP/HZwBtAQ5nZLdumrmZy8a8+sqphhd/7FWlr/RC+X/6x5fEILtbu717/gCpHP V+p1MFzD6F+yyyemoPSd0tmpF34pgqFelECqpC98tpODaZaY6xkYplEwDGW5kXnH9vtRkj8yOwhI4 Zff2+l7aqat7qQjFhO51sC8rUdARZhzgYZz2bqJRGYkKCM+WGjYzTPXcIoA/yobnIEqrBCZynCoDx gGVS45bw==; Received: by zero.zsh.org with local id 1otCFW-0000Fc-1H; Thu, 10 Nov 2022 18:26:02 +0000 Authentication-Results: zsh.org; iprev=pass (mta04.eastlink.ca) smtp.remote-ip=24.224.136.10; dmarc=none header.from=eastlink.ca; arc=none Received: from mta04.eastlink.ca ([24.224.136.10]:60162) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1otCEy-000PWx-Aw; Thu, 10 Nov 2022 18:25:28 +0000 Received: from csp02.eastlink.ca ([71.7.199.167]) by mta04.eastlink.ca (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) with ESMTPS id <0RL50064N967OV20@mta04.eastlink.ca> for zsh-users@zsh.org; Thu, 10 Nov 2022 14:25:27 -0400 (AST) Received: from [192.168.0.3] ([24.207.18.108]) by Eastlink with ESMTPSA id tCEwo318EgfyjtCEwocl9B; Thu, 10 Nov 2022 14:25:27 -0400 X-Authority-Analysis: v=2.4 cv=M9uLaQ8s c=1 sm=1 tr=0 ts=636d4217 a=xN66ZtSbq5jdJYpBp7G/jQ==:117 a=xN66ZtSbq5jdJYpBp7G/jQ==:17 a=IkcTkHD0fZMA:10 a=nhD0cfh6iMZwv5uWCU4A:9 a=QEXdDO2ut3YA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrfeeggdduudegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecugfetuffvnffkpffmpdfqfgfvnecuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfhfhjggtgfesthekredttdefjeenucfhrhhomheptfgrhicutehnughrvgifshcuoehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgeqnecuggftrfgrthhtvghrnhepiedtjeffvefgtdehgefgteekueeggeeitedutddvvdduteetffdvveelgfeukedunecukfhppedvgedrvddtjedrudekrddutdeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdegrddvtdejrddukedruddtkedphhgvlhhopegludelvddrudeikedrtddrfegnpdhmrghilhhfrhhomheprhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepreerpdhrtghpthhtohepiihshhdquhhsvghrshesiihshhdrohhrghdpghgvthdqkghiphfrrghsshifugepthhruhgv X-Vade-Score: 0 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Message-id: <549715c2-8b36-8b7e-e3ac-cac02f43dd0f@eastlink.ca> Date: Thu, 10 Nov 2022 10:25:26 -0800 MIME-version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: coloring substitution seems to eat next line. Content-language: en-US To: zsh-users@zsh.org References: From: Ray Andrews In-reply-to: Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 8bit X-Seq: 28357 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: On 2022-11-10 00:02, Roman Perepelitsa wrote: > Differences in the second version compared to the first: Sorry about the sloppy code Roman,  the differences there don't matter but you have no way of knowing that. > - aa instead of $aa Does that matter?  I thought it was one of those situations where the dollar sign is optional. > - slice assignment instead of scalar (almost certainly unintended) Indeed.  I don't even know what the difference is.  I've never heard of slice assignment :( > Given that the second version works without errors The first version using sed. > This means you can replace > the whole loop with this: > > local MATCH MBEGIN MEND > cc=(${cc//(#m)$~zsh_case$filter/$'\e[31;1m'$MATCH$'\e[0m'}) Unfortunately not.  That works as you intend, but I need to filter not just colorize.  Any line without all matches must be deleted.  The 'for' loop runs the lines thru each filter in turn and must zero any line that does not match. You can debug this by printing all relevant parameters. > print -r -- "going in: $cc[aa]" > typeset -p cc aa filter Good idea!  That's going to be useful.