Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
Bruno Heridet edited this pageSep 28, 2017 ·1 revision

eval /exec commands are very powerful construct. They support many switches that may be hard to understand at first.This page attempts to clarify their usage.

-itersel

run once for each selection with that selection at the only one

Let's start by a simple buffer content:

foobarqux

and make 3 selections with:wCC. The main selection is therefore onqux.

def no-loop %{  eval %{    echo -debug %val{selection}    echo -debug %val{selections}  }}

If we run the aboveno-loop command, here's the output of the `debug buffer:

quxfoo:bar:qux

Now, let's add the-itersel switch:

def loop %{  eval -itersel %{    echo -debug %val{selection}    echo -debug %val{selections}  }}

This time, if we run thisloop command, here's the debug output:

foofoobarbarquxqux

A few things to observe:

  • the iteration starts fromfoo despite the fact thatqux is our main selection. If the main selection wasbar (by rotating with the' command), the result would be the same.
  • as stated in the description of theitersel switch, in eachloop,%val{selection} ==%val{selections}
Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp