Theia: ctrl+f defaults to the browser search

Created on 8 Apr 2020  路  21Comments  路  Source: eclipse-theia/theia

Description

Reproduction Steps

  • open SIW view
  • press ctrl+f to retrigger search
  • native browser search is shown
  • search is not retriggered

OS and Theia version:

Diagnostics:

bug core keybindings

All 21 comments

  • native browser search is shown

FYI: previously we throw an exception: https://github.com/eclipse-theia/theia/issues/7474

@kittaakos you are right about #7346

I'm still not sure about falling back to the native search.

We have to re-introduce a NOOP core.find then.

What about core.replace? We used to prevent it as well.

What about core.replace?

Yes. Obviously, it belongs here.

We used to prevent it as well.

"prevent" 馃槃 yes.


I think Select All, Find, and Replace should be generalized all over the application; the active widget should handle it if it can, otherwise we have to fall-back to the default NOOP. Most likely that's a bigger task.

I think Select All, Find, and Replace should be generalized all over the application; the active widget should handle it if it can, otherwise we have to fall-back to the default NOOP

Strangely the same issue present in VS Code, try with the terminal for instance:

  • if you use a find keybinding then it shows find widget in the terminal
  • but if you use Edit -> Find it does nothing.

I don't think that's nice though.

Actually before it was working like in VS Code: if you have an opened editor which is not focused, Find and Replace will still applied to this editor. It does not work only in the case if a widget, e.g. terminal, has own command. I think we should align again with it.

I think we should align again with it.

I don't like the idea because then we have to handle monaco commands differently, one command (find, replace) would require an editor, it does not necessarily have to have the focus. Other commands, such as select all, undo would require a focused editor.

But please go ahead if you think it is better.

I don't like the idea because then we have to handle monaco commands differently, one command (find, replace) would require an editor, it does not necessarily have to have the focus. Other commands, such as select all, undo would require a focused editor.

I afraid that it will be surprising to users, since it used to work like that in Theia for other commands except undo, redo, select all and work like that in VS Code.

since it used to work like that in Theia

But it threw an error.

Side effect of "Select All" for the "Problem" view. When using the cmd+a to selct all, it also select all line ranges in the open editor.
SelectAll

But it threw an error.

yes, this thing we can fix by no-op core find/replace handlers which are always enabled, since we have reverse handlers Monaco and terminal extensions will win

@lmcbout please file a separate issue. The problems view should have Select All command similar to the debug console.

@kittaakos I'm trying to figure out where do we check when closures and preconditions of Monaco commands/actions with the new approach. We used to do it via MonacEditor.isActionSupported. Do we completely ignore them now?

For the built-in Monaco commands, yes.

Why is it better? Don't we ignore internal Monaco logic, i.e. we call a command when Monaco does not expect it. Should not we evaluate them instead in isEnabled callback?

Why is it better?

Otherwise, you never execute anything from VS Code's coreCommands.

Update: fixed the module name, added link.

Otherwise, you never execute anything from VS Code's coreCommand.

You mean for undo, redo, select all? I thought Monaco does the same what our core command doing for such cases, i.e. document.execCommand? For other I don't think they are enabled always, it should depend on when closure as before.

I wonder also why do we need ElectronUndoHandler and other handlers? If it is based on Chromium and calls at the end document.execCommand. VS Code does not seem to do it.

Was this page helpful?
0 / 5 - 0 ratings