vscode-emacs-mcx icon indicating copy to clipboard operation
vscode-emacs-mcx copied to clipboard

Resuming incremental search replaces old search with word at current location

Open m27315 opened this issue 5 years ago • 9 comments

Steps to Reproduce

  1. Search for word (C-s).
  2. Exit incremental search through movement (e.g., C-a, jump to front of line).
  3. Assuming a different word is now under the cursor, resuming the incremental search (pressing C-s again) will instead search for the current word instead of resuming previous search.

Expected Behavior

Emacs would resume the previous incremental search, instead of starting a new search with the word under the cursor.

Versions

Awesome Emacs Keymap: 0.11.2
VSCode Version: 1.33.1
Commit: 51b0b28134d51361cf996d2f0a1c698247aeabd8
Date: 2019-04-11T08:20:22.771Z
Electron: 3.1.6
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Linux x64 4.19.27-gentoo-r1

m27315 avatar Apr 19 '19 19:04 m27315

Setting editor.find.seedSearchStringFromSelection to false will stop the find widget from doing this. Perhaps the extension should set this setting.

joeshaw avatar May 16 '19 20:05 joeshaw

It seems overriding configuration by extension is not allowed now. Related issue: https://github.com/microsoft/vscode/issues/26707#issuecomment-461538461

For now, please set editor.find.seedSearchStringFromSelection config as @joeshaw wrote by yourself. Thanks!

whitphx avatar Jun 12 '19 15:06 whitphx

I love the extension, but this particular problem with C-s has been driving me nuts. Thanks for the workaround!

TTimo avatar Feb 16 '20 16:02 TTimo

memo: https://github.com/microsoft/vscode/issues/1396

whitphx avatar Mar 16 '20 15:03 whitphx

https://code.visualstudio.com/docs/getstarted/settings#_default-settings

link to the config docs as it's not a boolean type as the comments above suggest. the config accepts "never", "always", "selection"

laktech avatar Jan 15 '22 21:01 laktech

Thank you. It seems to have been changed at v1.59: https://github.com/microsoft/vscode-docs/commit/a27b0efea3c05b4e06548dba1ad6b58979f1a79a#diff-d432cc9e616a920ea35cfeddb72b780f663270fd96f6871ec99dc8bda5b8cfb5R350

I will update the README of this extension.

whitphx avatar Jan 20 '22 14:01 whitphx

Yet, this page still says

This feature can be turned off by setting editor.find.seedSearchStringFromSelection to false.

So it seems to accept both false and "never".

whitphx avatar Jan 20 '22 14:01 whitphx

https://github.com/whitphx/vscode-emacs-mcx/pull/1168

whitphx avatar Jan 20 '22 15:01 whitphx

Updating the VSCode settings seems to be possible:

  • https://stackoverflow.com/questions/68526627/vscode-extension-how-do-i-edit-workspace-global-config
  • https://stackoverflow.com/questions/54356069/vs-code-extension-to-update-workspace-settings

-> Try to set editor.find.seedSearchStringFromSelection programatically.

whitphx avatar Jan 24 '22 07:01 whitphx

~~From 0.54.0, this extension overrides the default value of editor.find.seedSearchStringFromSelection to "never" so the workaround introduced above will no longer necessary. It still allows configuring the setting by users, so people who like VSCode's default behavior like #1278 can use it while they need to edit the settings by hand.~~

I changed my mind and overriding the default value of the global config is too aggressive, so reverted it #1768, v0.51.1.

whitphx avatar Nov 12 '23 15:11 whitphx