Giter VIP home page Giter VIP logo

Comments (4)

Nukesor avatar Nukesor commented on June 15, 2024 2

Of course. I completely forgot that rpc communication happens via stdout/stdin.
Removing the println! indeed resolved this bug. I kind of feel stupid about this one.
Sorry for causing you any inconvenience and thanks for helping and for providing this library!

from neovim-lib.

KillTheMule avatar KillTheMule commented on June 15, 2024 1

I've seen this error often, and always in the following 2 circumstances:

  • A neovim misfeature (which limited message size to 10MB, fixed now to be 2GB)
  • I made a mistake which made neovim hang up the channel

First, I'd look at the log of a debug build of neovim built with MIN_LOG_LEVEL=0 to see if that tells you anything.

But I see in your case there's an error in there that tells you that you sent something wrong. I could not perform a proper analysis now, but I'd BET that println! wreaks havoc with running rpc over stdin/stdout (don't ask how often I've made that mistake).

from neovim-lib.

boxofrox avatar boxofrox commented on June 15, 2024 1

I can confirm the error reported disappears when the following patch to remove the only println!() is applied.

diff --git a/src/main.rs b/src/main.rs
index 33e24fd..2044f44 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -85,7 +85,6 @@ fn start_event_loop(receiver: mpsc::Receiver<Event>, mut nvim: Neovim) {
     loop {
         info!("Waiting");
         let payload = receiver.recv();
-        println!("Received Payload: {:?}", payload);
         match payload {
             Ok(Event::Shutdown) => {
                 info!("Shutting down");

from neovim-lib.

boxofrox avatar boxofrox commented on June 15, 2024

Could you provide a list of steps to reproduce?

Also, since you continue to make changes, could you post which revision exhibited this behavior? Your recent change to rename ctrlp.vim to ctrlprs.vim breaks the init.vim which still sources the old filename.

After correcting the filename in init.vim, I tried these steps.

# At shell prompt.
nvim -u init.vim

# In neovim v0.3.4.  Initialize ctrlp-rs.  The line after is an echoed result.
:call ctrlprs#init()
ctrlp error: stderr

# Check messages.
:messages
ctrlp-rs: Started process
ctrlp error: stderrthread 'main' panicked at 'scorched earth: unable to initialize logger.: Os { code: 2, kind: NotFound, message: "No such file or directory"
}', src/libcore/result.rs:997:5^@note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
ctrlp error: stderr

I'm obviously missing something in order to reproduce your error, but I'm not sure what.

Update 1

The following patch fixed the No such file or directory error.

diff --git a/src/main.rs b/src/main.rs
index 33e24fd..8bdb475 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -59,7 +59,7 @@ fn init_logging() -> Result<(), Box<Error>> {
         time_format: None,
     };

-    let filepath = "/home/nuke/ctrlp.log";
+    let filepath = "./ctrlp.log";

     let log_file = File::create(filepath)?;

from neovim-lib.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.