Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console issues #66

Closed
mikeTWC1984 opened this issue Sep 2, 2019 · 6 comments
Closed

Console issues #66

mikeTWC1984 opened this issue Sep 2, 2019 · 6 comments

Comments

@mikeTWC1984
Copy link
Contributor

This configuration doesn't seem to work:
"powershell.integratedConsole.focusConsoleOnExecute":true

If I close PSIC window and execute evaluateSelection or Execute commands PSIC window will not come back.

Other thing. I was browsing extensions.js file, I see that consoleTerminal has show and hide methods. Is it possible to map those as coc commands? (assuming these methods showing/hiding that terminal window indeed). This would let us to implement proper toggling feature (I opened a ticket with cocnvim but it probably will take a while/forever)

@TylerLeonhardt
Copy link
Collaborator

If I close PSIC window

How do you close the PSIC window? With :q? If so, do you still get intellisense in the editor buffer?

I opened a ticket with cocnvim but it probably will take a while/forever

Do you have a link to the issue? Maybe I can help - this really should be a thing in coc.nvim.

@mikeTWC1984
Copy link
Contributor Author

mikeTWC1984 commented Sep 3, 2019

Yeah, I close it with q. But I do it just to get more space for my script, so if I run script or selection I definitely need get that console back. I realized that showTerminalIfVisible function is just used to move cursor to the PSIC buffer (when running F5/F8). I think we actually should do the opposite (same way as VSCode) - show it if it's hidden, that would make this function much more meaningful (it still can manage cursor location).

   public async showTerminalIfVisible() {
        if (this.consoleTerminal) {
            const winid: number = await vscode.workspace.nvim.eval(`bufwinid(${this.consoleTerminal.bufnr})`) as number;

            // If winid is -1, it means the window is not visible/is hidden.
            if (winid == -1) {this.consoleTerminal.show()}
             this.consoleTerminal.show(!this.config.integratedConsole.focusConsoleOnExecute);
            // mike1984 -  always show if hidden and do the cursor trick based on settings 
        }
    } 

Also, if we add extra else statement to that function it would actually do the toggling

     if (winid == -1) {this.consoleTerminal.show()} else {this.consoleTerminal.hide()}

I guess we can add it in this form until (and if) it's implemented on cocnvim's end

@mikeTWC1984
Copy link
Contributor Author

Also, I'm still looking forward to use dot sourcing (vs &) for execute command, so it works the same way as ISE. I guess we can create extra configuration to keep both options

@TylerLeonhardt
Copy link
Collaborator

@mikeTWC1984 well unfortunately coc.nvim has asked us to implement the toggle ourselves. Since you seem to have an understanding of what needs to be done, do you wanna submit a PR?

Also, I'm still looking forward to use dot sourcing (vs &) for execute command, so it works the same way as ISE. I guess we can create extra configuration to keep both options

It really dot sources it? That seems like it could cause some problems with scoping that could confuse the user? I'm fine adding it in with a configuration but I am inclined to say that & should be the default since it's safer. What do you think about that?

@mikeTWC1984
Copy link
Contributor Author

@TylerLeonhardt OK, I submitted PR, although it didn't pass autocheck (it wants some syntax improvements), I'll keep it as is for now.

@TylerLeonhardt
Copy link
Collaborator

This setting was added in #94. Closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants