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

Can't enable C-n completion #390

Open
dsdshcym opened this issue Dec 19, 2015 · 12 comments
Open

Can't enable C-n completion #390

dsdshcym opened this issue Dec 19, 2015 · 12 comments

Comments

@dsdshcym
Copy link

@dsdshcym dsdshcym commented Dec 19, 2015

I'm using chrome on OS X.

If I set the nextCompletionResult keybinding to C-n, C-n
will become open a new window. Instead of select next completion.

@1995eaton
Copy link
Owner

@1995eaton 1995eaton commented Dec 26, 2015

nextCompletionResult will open a new page unless the command bar is focused. Also, are you setting the binding in the settings page or the keybindings page in chrome://extensions?

@dsdshcym
Copy link
Author

@dsdshcym dsdshcym commented Dec 27, 2015

@1995eaton Yes, I bind cncpcompletion to C-n in chrome://extensions.

I don't know if this is related: I also have set noinsertmappings in my
cVimrc. And my C-p completion is working without setting cncpcompletion to
anything.

@raulchen
Copy link

@raulchen raulchen commented Sep 18, 2016

I have the same problem. Already set chrome://extensions, but chrome still opens new windows when I press C-n

@1995eaton 1995eaton closed this in 103483c Feb 17, 2017
hbt added a commit to hbt/mouseless that referenced this issue Feb 17, 2017
* commit '103483c6571da01d89d4eb4d7e1a8155accf3209':
  Fix 1995eaton#390

Conflicts:
	background_scripts/main.js
hbt added a commit to hbt/mouseless that referenced this issue Feb 18, 2017
* dev:
  wip
  wip
  wip
  wip
  Treat select elements as input elements (1995eaton#504)
  Workaround for 1995eaton#504
  fixed 1995eaton#81 multithreaded external editor
  fixed 82 - added default value
  reviewed todos (minor) + moved to tickets
  Fix 1995eaton#390
  Set globals format for pegjs
@1995eaton 1995eaton reopened this Feb 27, 2017
hbt added a commit to hbt/mouseless that referenced this issue Mar 4, 2017
* commit 'f3f05ce294f023c39e5ef1d03ec8312723f324e1':
  revert pr 1995eaton#502, this would not be a solution to 1995eaton#390

Conflicts:
	background_scripts/main.js
hbt added a commit to hbt/mouseless that referenced this issue Mar 11, 2017
* dev:
  wip
  wip
  fix 1995eaton#524
  Open links indirectly to activate cVim at the new tab on Vivaldi.
  New insert function: beginningOfLineOrSelectAll.
  added new sitefilters example added scripts to generate docs
  wip
  wip
  hints cleanup post merge
  wip
  wip
  wip
  restores definePrototype function
  a lot of link hint changes
  improve parser
  add support for rhs identifier references in parser
  selected -> active
  temporarily remove support for local/base64 images in reverse image search function (not working anymore)
  add view source command
  revert pr 1995eaton#502, this would not be a solution to 1995eaton#390
  never override builtin prototypes
  cleanup
  wip
  wip
  wip
  wip
  make buffers in current window have priority
  fix CSS style issue on options page
  possibly fix 1995eaton#518
  Fix single line comment issues (1995eaton#516) and add support for pegjs 0.10
  wip
  wip
@simonwjackson
Copy link

@simonwjackson simonwjackson commented Sep 7, 2017

I am also having this issue. C-N opens a new window even after changing the settings in the keybindings page

@cosminadrianpopescu
Copy link

@cosminadrianpopescu cosminadrianpopescu commented Sep 11, 2017

In the file background_scripts/main.js, on line 173, on the case 'nextCompletionResult' branch, there is this:

chrome.windows.create({url: 'chrome://newtab'});

If I comment this line, and then set the shortcut in chrome://extensions, then ctrl+n works as expected.

Does anyone have any idea what is the logic of this line?

@thanhvg
Copy link

@thanhvg thanhvg commented Nov 16, 2017

To my understanding that chrome.windows.create({url: 'chrome://newtab'}); is supposed to be the callback invoked only when <c-n> is pressed outside ex mode and cncpcompletion === false, so default action (new window) can be in force.

This piece of code in messenger.js checks the above conditions.

  case 'nextCompletionResult':
   if (window.isCommandFrame) {
      if (settings.cncpcompletion &&
          Command.commandBarFocused() &&
          Command.type === 'action') {
        Search.nextResult();
        break;
      }
      callback(true); // ==> create new window
    }
    break;

Ideally callback only runs when the check fails and new window is created as expected. But even when the check fails callback still runs with an undefined argument.

Pr #502 fixes this issue I don't know why it was reverted.

@jmbeach
Copy link

@jmbeach jmbeach commented Nov 20, 2017

@thanhvg That code didn't work for me. I had to do as @cosminadrianpopescu said and just comment out that line.

@thanhvg
Copy link

@thanhvg thanhvg commented Nov 20, 2017

@jmbeach I was trying to explain why chrome.windows.create({url: 'chrome://newtab'}); was there. I didn't propose any change at all.

Of course if you remove it c-n will work on ex mode without creating new window, but you will not be able to use c-n as hotkey to create new window when you are not in ex mode.

What I don't understand is Pr #502 fixed this, @1995eaton merged it to master then reverted it several days later.

@jmbeach
Copy link

@jmbeach jmbeach commented Nov 21, 2017

@thanhvg gotcha.

@achilleas-k
Copy link

@achilleas-k achilleas-k commented Dec 12, 2017

i'd like to get an idea of how issue #578 relates to this one. Is there an assumption that the nextCompletionResult keybinding C-n?

Not to turn this issue into a feature request, but does anyone feel it might be cleaner to make it possible to have C-n be ONLY nextCompletionResult without it also being new window? I tend to use C-n for nextTab and in that case, it does disable new window, but then it can't be used for anything else, not even as an insert mapping. I'm just curious whether it would be simpler to (optionally) globally disable C-n as the new window shortcut and that way not have the default fallback in the code discussed above.

@JC1738
Copy link

@JC1738 JC1738 commented Feb 15, 2018

This seems to still be an issue. Setting c-n in extension opens a new window. Setting it to another character has the same result. c-p does work on cycling backward.

@chriswu000
Copy link

@chriswu000 chriswu000 commented Dec 16, 2019

What are the other ways to navigate the completion list? My arrow keys also don't work.... I've love to be able to use control-N/P or control-J/K but doesn't seem to be a working options.... Thanks!

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

Successfully merging a pull request may close this issue.

None yet
10 participants