profile
viewpoint

I60R/page 68

Use neovim as pager

I60R/ActivityRx 2

RxJava bindings to Activities

I60R/alias-tips 0

An oh-my-zsh plugin to help remembering those aliases you defined once

I60R/android-drawable-resizer 0

Gradle plugin for resizing Android drawables for lower screen densities

I60R/BroadcastRx 0

RxJava bindings to BroadcastReceiver

I60R/presstofg.webext 0

Press on link to open in foreground tab

push eventI60R/page

160R

commit sha ef07b18d5f7932e1a97fa1e94da8590f797beea5

add -O option; use usize; reformat

view details

push time in 12 days

push eventI60R/page

160R

commit sha 789113ff1026475d09afddc017ace60c6d66ca13

upd. README

view details

push time in 14 days

issue closedI60R/page

Error when opened without existing nvim instance

If I understood correctly I should be able to use page even without an active nvim instance, but this gives me the following error after executing page Cargo.lock (file from the git repo):

thread 'main' panicked at 'Cannot connect to parent neovim: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:1165:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

With env RUST_BACKTRACE=1 page Cargo.lock:

thread 'main' panicked at 'Cannot connect to parent neovim: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:1165:5
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/libunwind.rs:88
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:77
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:61
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1028
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1412
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:65
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:50
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:188
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:205
  10: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:464
  11: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:373
  12: rust_begin_unwind
             at src/libstd/panicking.rs:302
  13: core::panicking::panic_fmt
             at src/libcore/panicking.rs:139
  14: core::result::unwrap_failed
             at src/libcore/result.rs:1165
  15: page::main
  16: std::rt::lang_start::{{closure}}
  17: main
  18: __libc_start_main
  19: _start
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

echo $NVIM_LISTEN_ADDRESS returns /tmp/nvimsocket which I configured for nvr this might have something to do with this error.

env NVIM_LISTEN_ADDRESS= page Cargo.lock opens the file views it for a split second after which only an empty buffer is visible, page outputs /tmp/neovim-page/DO-NOT-REDIRECT-OUTSIDE-OF-NVIM-TERM(--help[-W]) on the command line.

env NVIM_LISTEN_ADDRESS= page -W Cargo.lock gets the same result but without any output on the commandline.

closed time in 14 days

sandersantema

issue closedI60R/page

Search for pattern and move cursor

I'm using page for my scroll back buffer in kitty and I would like to set the cursor at the last non-empty line. I tried searching for a particular pattern in my prompt to move the cursor there, but I haven't been able to do it successfully. I believe the problem is that at the time I'm doing the search there's still no text on the screen. This is what I'm trying:

au User PageDisconnect call feedkeys("G?╼\<CR>")

I also tried redrawing before doing the search but it's still failing.

au User PageDisconnect redraw | call feedkeys("G?╼\<CR>")

Do you have any ideas on how to get around this issue?

Ultimately, I think the problem is the terminal emulator in vim putting empty lines at the end of the buffer.

closed time in 14 days

nilehmann

issue commentI60R/page

Search for pattern and move cursor

This could be even simpler:

map f1 launch --stdin-source=@screen_scrollback --stdin-add-formatting bash -c "sd '\s*\z' '' | page -f"

nilehmann

comment created time in 14 days

push eventI60R/page

160R

commit sha f43758a59e35e178cd33fa4bb567e9f0d98f2283

upd. README

view details

push time in 14 days

push eventI60R/page

160R

commit sha 1f863e637c2f3af47fc70c06486898fc1477a50b

upd. README

view details

push time in 14 days

push eventI60R/page

160R

commit sha 40d907eb9febd50eb9313bd22a2c69f2b8c7f432

upd. README

view details

push time in 14 days

push eventI60R/page

160R

commit sha 8c427727c4e0435fe48b9c6cb5e9529eafc98b87

upd. README

view details

push time in 14 days

create barnchI60R/page

branch : next_release

created branch time in 14 days

issue commentI60R/page

Search for pattern and move cursor

Stripping these trailing lines should fix the issue completely

map f1 launch --stdin-source=@screen_scrollback --stdin-add-formatting bash -c "sd '\s*\z' '' | page -C -e 'au User PageDisconnect sleep 100m | call feedkeys(\"G$?\\\S\<CR>\<C-l>\")'"

Also, it seems that kitty doesn't support | in map or does it in unobvious and poorly documented way, so I've must to reuse bash for it

nilehmann

comment created time in 15 days

issue commentI60R/page

Search for pattern and move cursor

Do you have any ideas on how to get around this issue?

map f1 launch --stdin-source=@screen_scrollback --stdin-add-formatting page -C -e 'au User PageDisconnect sleep 100m | call feedkeys("G$?\\S\<CR>\<C-l>")'

This works for me

Ultimately, I think the problem is the terminal emulator in vim putting empty lines at the end of the buffer.

These lines are sent from kitty e.g. if I have half of the screen empty then that emptiness will be displayed in scrollback preview too and it seems that less displays it as well

nilehmann

comment created time in 17 days

startedmarlonrichert/zsh-autocomplete

started time in a month

created tagI60R/page

tagv2.3.5

Use neovim as pager

created time in a month

delete tag I60R/page

delete tag : v2.3.5

delete time in a month

push eventI60R/page

160R

commit sha 7e62141934c2769bebb0ed878c19600516f11655

fix #14

view details

push time in a month

created tagI60R/page

tagv2.3.5

Use neovim as pager

created time in a month

release I60R/page

v2.3.5

released time in a month

IssuesEvent

push eventI60R/page

160R

commit sha 94dd0f8a4d28c54b934153d23b500b82ffa372aa

fix #14

view details

push time in a month

issue closedI60R/page

NVIM_LISTEN_ADDRESS= page FILE not revokes -o option

As reported by @sandersantema in #12:

env NVIM_LISTEN_ADDRESS= page Cargo.lock opens the file views it for a split second after which only an empty buffer is visible, page outputs /tmp/neovim-page/DO-NOT-REDIRECT-OUTSIDE-OF-NVIM-TERM(--help[-W]) on the command line.

env NVIM_LISTEN_ADDRESS= page -W Cargo.lock gets the same result but without any output on the commandline.

closed time in a month

I60R

push eventI60R/page

160R

commit sha d1a5073c44afa2ca3b15d469015825b45d58ea0d

fix #12

view details

push time in a month

issue closedI60R/page

Error when opened without existing nvim instance

If I understood correctly I should be able to use page even without an active nvim instance, but this gives me the following error after executing page Cargo.lock (file from the git repo):

thread 'main' panicked at 'Cannot connect to parent neovim: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:1165:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

With env RUST_BACKTRACE=1 page Cargo.lock:

thread 'main' panicked at 'Cannot connect to parent neovim: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:1165:5
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/libunwind.rs:88
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:77
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:61
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1028
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1412
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:65
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:50
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:188
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:205
  10: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:464
  11: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:373
  12: rust_begin_unwind
             at src/libstd/panicking.rs:302
  13: core::panicking::panic_fmt
             at src/libcore/panicking.rs:139
  14: core::result::unwrap_failed
             at src/libcore/result.rs:1165
  15: page::main
  16: std::rt::lang_start::{{closure}}
  17: main
  18: __libc_start_main
  19: _start
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

echo $NVIM_LISTEN_ADDRESS returns /tmp/nvimsocket which I configured for nvr this might have something to do with this error.

env NVIM_LISTEN_ADDRESS= page Cargo.lock opens the file views it for a split second after which only an empty buffer is visible, page outputs /tmp/neovim-page/DO-NOT-REDIRECT-OUTSIDE-OF-NVIM-TERM(--help[-W]) on the command line.

env NVIM_LISTEN_ADDRESS= page -W Cargo.lock gets the same result but without any output on the commandline.

closed time in a month

sandersantema

issue commentI60R/page

Error when opened without existing nvim instance

For instance launching nvim with NVIM_LISTEN_ADDRESS unset: env NVIM_LISTEN_ADDRESS= nvim in nvim :echo v:servername will return /tmp/nvimnWij4Z/0which will be different if I launch nvim again.

That's right. But if you further launch :term and run echo $NVIM_LISTEN_ADDRESS on it then you will find that NVIM_LISTEN_ADDRESS is set and it's the same as v:servername value.

Here you can use page and nvr and they should connect to parent neovim process just fine without any /tmp/nvimsocket tweaks.

And yes, NVIM_LISTEN_ADDRESS has two purposes, that's confusing, and that's why they introduced --listen instead of one of them.

That way if NVIM_LISTEN_ADDRESS isn't set nvr will not know which socket to send stuff to if I understood correctly.

If it isn't set then both page and nvr will launch a new neovim process and will use it. Again, /tmp/nvimsocket in this case isn't required.

Having global NVIM_LISTEN_ADDRESS might have sense only if you want to keep a singe system-wide neovim instance that would be used by various clients like page and nvr from different terminals. For me this setup feels completely broken, so I don't see any sense in setting global NVIM_LISTEN_ADDRESS or in using --listen option. It probably was put in neovim-remote README only to explain how things work under the hood but this turned out to be only confusing for users.

after opening nvim focuses on another split, i.e. I have to splits open one with nothing in it and the other a terminal after opening something with page my cursor is in the window with nothing in it.

This is the bug and I've reported and I've fixed it already. Fix will be included in the next version of page which I hope to release soon (maybe even today)

sandersantema

comment created time in 2 months

issue commentclap-rs/clap

Better than display_order and DeriveDisplayOrder argument positioning

We have them. help_heading.

The whole point isn't in having them, but in having them in the same place and not using them explicitly.

You are not exactly giving us a sample of the code where DeriveDisplayOrder is not working in clap_derive. As I said before, flattening the struct should work with the option well.

That's actually the problem e.g. if you have this unflattened struct:

#[derive(StructOpt)]
#[structopt(global_settings=&[DeriveDisplayOrder])]
struct Opt {
    a: bool,
    b: bool,
    c: bool,
    ...
}

and then refactors it to flattened

#[derive(StructOpt)]
#[structopt(global_settings=&[DeriveDisplayOrder])]
struct Opt {
    b: bool,
    #[structopt(flatten)]
    flattened: Flattened,
    ...
}

#[derive(StructOpt)]
struct Flattened {
    a: bool,
    c: bool,
}

you may find that the original order is messed up (b-a-c) and there's no straightforward way to fix it

I60R

comment created time in 2 months

issue commentclap-rs/clap

Better than display_order and DeriveDisplayOrder argument positioning

I'm open to others opinions as well, but even when flattening the order should be preserved. That sounds like a new issue to me, or perhaps we re-name this issue and update the OP with this new constraint/requirement.

Done. I also think that I've found what argument positioning I want:

  1. With DeriveDisplayOrder we increment each arg display_order starting from 1000 but only for those that had it unspecified. Then, if multiple args sharing the same display_order they would be sorted alphabetically (default behavior).

  2. Instead or alongside with we may provide display_all method for App and ArgGroup which would be used like this:

    display_all = &[
        ("FLAGS", &[
            "first",
            "second",
            "x",
            ...
        ]),
        ("OPTIONS", &[
            "nth",
            "nth+1",
            ...
        ]),
        ...,
        ("CUSTOM SECTION", &[
            ...,
            "last-1",
            "last"
        ])
    ],

it could substitute display_order and display functions, plus add more styling options like custom section headers, separators, etc.

@kbknapp is it possible to be implemented?

I60R

comment created time in 2 months

issue commentI60R/page

Add quit-if-one-screen option

Hello,

thank you too for good words and for this feature request. It seems to be useful feature, and now I have plans to implement it

jlesquembre

comment created time in 2 months

issue commentI60R/page

NVIM_LISTEN_ADDRESS= page FILE not revokes -o option

This should be trivial to fix

I60R

comment created time in 2 months

issue openedI60R/page

NVIM_LISTEN_ADDRESS= page FILE not revokes -o option

As reported by @sandersantema in #12:

env NVIM_LISTEN_ADDRESS= page Cargo.lock opens the file views it for a split second after which only an empty buffer is visible, page outputs /tmp/neovim-page/DO-NOT-REDIRECT-OUTSIDE-OF-NVIM-TERM(--help[-W]) on the command line.

env NVIM_LISTEN_ADDRESS= page -W Cargo.lock gets the same result but without any output on the commandline.

created time in 2 months

issue commentI60R/page

Error when opened without existing nvim instance

Hello and sorry for delayed feedback

echo $NVIM_LISTEN_ADDRESS returns /tmp/nvimsocket

This is what causes problems: in your case page is trying to connect to neovim server at /tmp/nvimsocket address which doesn't exists.

which I configured for nvr

Does nvr reqire such configuration? I don't understand the purpose of having global $NVIM_LISTEN_ADDRESS variable; as far as I know it should only be exposed under :term shell in order to allow clients like page and nvr to attach to parent neovim process.

Previously it was accepted by neovim to manually set the address on which it will listen to commands, but now this becomes deprecated in favor of --listen option.

That said, you was probably confused by README in neovim-remote repo, and manually setting NVIM_LISTEN_ADDRESS before each nvr invocation is not necessary

sandersantema

comment created time in 2 months

issue closedneovim/neovim

:term doesn't respect $SHELL variable set from inside of neovim

  • nvim --version: v0.5.0-418-g87d892afa
  • vim -u DEFAULTS (version: 8.2) behaves differently?: no
  • Operating system/version: 5.5.7-1-MANJARO
  • Terminal name/version: alacritty 0.4.2-dev
  • $TERM: xterm-256color

Steps to reproduce using nvim -u NORC

SHELL=/bin/bash nvim -u NORC
:let $SHELL = "/bin/zsh"
:term

Actual behaviour

Spawns bash

Expected behaviour

Spawns zsh

closed time in 2 months

I60R

issue commentneovim/neovim

:term doesn't respect $SHELL variable set from inside of neovim

This works, thank you!

I60R

comment created time in 2 months

issue commentclap-rs/clap

Add display_after for easier arg positioning in --help message

This might be pretty hairy to implement, especially if we end up trying to detect loops (A says display after B, and B says display after A).

Okay, I understand.

@I60R could you elaborate on why doesn't DeriveDisplayOrder work in your case?

I actually use it. The problem was that it don't play well with structopt flattening, more specifically it doesn't allow to move argument into separate struct while keeping its order in --help message. This could be easily structopt problem, however it also seems that it occurs because current display_order functionality in clap is somehow limited.

Arg::display_after in clap was simply the most straightforward solution here that I was able to imagine

I60R

comment created time in 2 months

startedKillingSpark/rustysd

started time in 3 months

startedtumpio/requestcontrol

started time in 3 months

startedArturKovacs/emulsion

started time in 3 months

issue openedclap-rs/clap

Add display_after for easier arg positioning in --help message

Make sure you completed the following tasks

  • [x] Searched the discussions
  • [x] Searched the closes issues

Describe your use case

The same as for Arg::display_order(usize) but should be easier to apply

Describe the solution you'd like

Add Arg::display_after(&str) method to position argument after another in --help output

Alternatives, if applicable

Keep using Arg::display_order(usize)

Additional context

It shouldn't move both arguments to top or to the bottom, as it's required currently when using .display_order (because 999 is default for every argument).

Also, DeriveDisplayOrder shouldn't override it

created time in 3 months

issue commentI60R/page

Unable to update from AUR repo

Ok, I've pushed rustc version check to AUR, so helpful error message will be issued for rustc < 40.


Also, it seems that you've missed this one: updating rustup via pacman doesn't update installed toolchains, so like in your case it's possible to have recent rustup and extremely outdated rustc, cargo, anything you've previously installed by rustup.

You need to manually update them by running rustup update.

And not by rustup self update because this is to update rustup by itself; installed by pacman it will simply not have enough permissions to upgrade - this exactly what Arch wiki wanted to say.

WANDEX

comment created time in 3 months

issue commentI60R/page

Unable to update from AUR repo

I think that 'rust' should be added as a required dependency for page-git AUR package

It wouldn't make any difference, since rustup also provides rust meta-package

or at least following line should be added to README

Once https://github.com/rust-lang/rust/issues/65262 will be implemented I'll add "minimum supported rust" version to Cargo.toml as well as badge with it into README.

Currently, the best I could made is to add if rustc < 1.40 then echo ERROR to PKGBUILD, so users will know exactly why their build is failing and what to do in order to fix it. That probably will be added with the next release of page, and up to that I will keep this issue open.

thank you once again, an excellent software btv.

Thank you as well, since by fixing issue reports I made it better :)

WANDEX

comment created time in 3 months

more