mirror of https://github.com/helix-editor/helix
Merge 55b3bd962b
into 205e7ece70
commit
94aa3f0326
|
@ -79,7 +79,8 @@
|
||||||
| `search_selection` | Use current selection as search pattern | normal: `` <A-*> ``, select: `` <A-*> `` |
|
| `search_selection` | Use current selection as search pattern | normal: `` <A-*> ``, select: `` <A-*> `` |
|
||||||
| `search_selection_detect_word_boundaries` | Use current selection as the search pattern, automatically wrapping with `\b` on word boundaries | normal: `` * ``, select: `` * `` |
|
| `search_selection_detect_word_boundaries` | Use current selection as the search pattern, automatically wrapping with `\b` on word boundaries | normal: `` * ``, select: `` * `` |
|
||||||
| `make_search_word_bounded` | Modify current search to make it word bounded | |
|
| `make_search_word_bounded` | Modify current search to make it word bounded | |
|
||||||
| `global_search` | Global search in workspace folder | normal: `` <space>/ ``, select: `` <space>/ `` |
|
| `global_search` | Global search in workspace folder (regex) | normal: `` <space>/ ``, select: `` <space>/ `` |
|
||||||
|
| `global_search_fixed_strings` | Global search in workspace folder (fixed strings) | |
|
||||||
| `extend_line` | Select current line, if already selected, extend to another line based on the anchor | |
|
| `extend_line` | Select current line, if already selected, extend to another line based on the anchor | |
|
||||||
| `extend_line_below` | Select current line, if already selected, extend to next line | normal: `` x ``, select: `` x `` |
|
| `extend_line_below` | Select current line, if already selected, extend to next line | normal: `` x ``, select: `` x `` |
|
||||||
| `extend_line_above` | Select current line, if already selected, extend to previous line | |
|
| `extend_line_above` | Select current line, if already selected, extend to previous line | |
|
||||||
|
|
|
@ -377,7 +377,8 @@ impl MappableCommand {
|
||||||
search_selection, "Use current selection as search pattern",
|
search_selection, "Use current selection as search pattern",
|
||||||
search_selection_detect_word_boundaries, "Use current selection as the search pattern, automatically wrapping with `\\b` on word boundaries",
|
search_selection_detect_word_boundaries, "Use current selection as the search pattern, automatically wrapping with `\\b` on word boundaries",
|
||||||
make_search_word_bounded, "Modify current search to make it word bounded",
|
make_search_word_bounded, "Modify current search to make it word bounded",
|
||||||
global_search, "Global search in workspace folder",
|
global_search, "Global search in workspace folder (regex)",
|
||||||
|
global_search_fixed_strings, "Global search in workspace folder (fixed strings)",
|
||||||
extend_line, "Select current line, if already selected, extend to another line based on the anchor",
|
extend_line, "Select current line, if already selected, extend to another line based on the anchor",
|
||||||
extend_line_below, "Select current line, if already selected, extend to next line",
|
extend_line_below, "Select current line, if already selected, extend to next line",
|
||||||
extend_line_above, "Select current line, if already selected, extend to previous line",
|
extend_line_above, "Select current line, if already selected, extend to previous line",
|
||||||
|
@ -2439,6 +2440,14 @@ fn make_search_word_bounded(cx: &mut Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn global_search(cx: &mut Context) {
|
fn global_search(cx: &mut Context) {
|
||||||
|
global_search_impl(cx, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn global_search_fixed_strings(cx: &mut Context) {
|
||||||
|
global_search_impl(cx, true)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn global_search_impl(cx: &mut Context, fixed_strings: bool) {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct FileResult {
|
struct FileResult {
|
||||||
path: PathBuf,
|
path: PathBuf,
|
||||||
|
@ -2457,6 +2466,7 @@ fn global_search(cx: &mut Context) {
|
||||||
|
|
||||||
struct GlobalSearchConfig {
|
struct GlobalSearchConfig {
|
||||||
smart_case: bool,
|
smart_case: bool,
|
||||||
|
fixed_strings: bool,
|
||||||
file_picker_config: helix_view::editor::FilePickerConfig,
|
file_picker_config: helix_view::editor::FilePickerConfig,
|
||||||
directory_style: Style,
|
directory_style: Style,
|
||||||
number_style: Style,
|
number_style: Style,
|
||||||
|
@ -2466,6 +2476,7 @@ fn global_search(cx: &mut Context) {
|
||||||
let config = cx.editor.config();
|
let config = cx.editor.config();
|
||||||
let config = GlobalSearchConfig {
|
let config = GlobalSearchConfig {
|
||||||
smart_case: config.search.smart_case,
|
smart_case: config.search.smart_case,
|
||||||
|
fixed_strings,
|
||||||
file_picker_config: config.file_picker.clone(),
|
file_picker_config: config.file_picker.clone(),
|
||||||
directory_style: cx.editor.theme.get("ui.text.directory"),
|
directory_style: cx.editor.theme.get("ui.text.directory"),
|
||||||
number_style: cx.editor.theme.get("constant.numeric.integer"),
|
number_style: cx.editor.theme.get("constant.numeric.integer"),
|
||||||
|
@ -2519,6 +2530,7 @@ fn global_search(cx: &mut Context) {
|
||||||
|
|
||||||
let matcher = match RegexMatcherBuilder::new()
|
let matcher = match RegexMatcherBuilder::new()
|
||||||
.case_smart(config.smart_case)
|
.case_smart(config.smart_case)
|
||||||
|
.fixed_strings(config.fixed_strings)
|
||||||
.build(query)
|
.build(query)
|
||||||
{
|
{
|
||||||
Ok(matcher) => {
|
Ok(matcher) => {
|
||||||
|
|
Loading…
Reference in New Issue