Mercurial > vim
comparison src/window.c @ 29853:31c598083364 v9.0.0265
patch 9.0.0265: no good reason why the "gf" command isn't in the tiny version
Commit: https://github.com/vim/vim/commit/f80f40a55ccff0a4331c5fbd1ac446511f622ed0
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Aug 25 16:02:23 2022 +0100
patch 9.0.0265: no good reason why the "gf" command isn't in the tiny version
Problem: No good reason why the "gf" command is not in the tiny version.
Solution: Graduate the file_in_path feature.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 25 Aug 2022 17:15:03 +0200 |
parents | 6c7eddcce52c |
children | c9ff1715f03d |
comparison
equal
deleted
inserted
replaced
29852:8568b72caa9a | 29853:31c598083364 |
---|---|
134 long Prenum, | 134 long Prenum, |
135 int xchar) // extra char from ":wincmd gx" or NUL | 135 int xchar) // extra char from ":wincmd gx" or NUL |
136 { | 136 { |
137 long Prenum1; | 137 long Prenum1; |
138 win_T *wp; | 138 win_T *wp; |
139 #if defined(FEAT_SEARCHPATH) || defined(FEAT_FIND_ID) | |
140 char_u *ptr; | 139 char_u *ptr; |
141 linenr_T lnum = -1; | 140 linenr_T lnum = -1; |
142 #endif | |
143 #ifdef FEAT_FIND_ID | 141 #ifdef FEAT_FIND_ID |
144 int type = FIND_DEFINE; | 142 int type = FIND_DEFINE; |
145 int len; | 143 int len; |
146 #endif | 144 #endif |
147 char_u cbuf[40]; | 145 char_u cbuf[40]; |
519 // Execute the command right here, required when "wincmd ]" | 517 // Execute the command right here, required when "wincmd ]" |
520 // was used in a function. | 518 // was used in a function. |
521 do_nv_ident(Ctrl_RSB, NUL); | 519 do_nv_ident(Ctrl_RSB, NUL); |
522 break; | 520 break; |
523 | 521 |
524 #ifdef FEAT_SEARCHPATH | |
525 // edit file name under cursor in a new window | 522 // edit file name under cursor in a new window |
526 case 'f': | 523 case 'f': |
527 case 'F': | 524 case 'F': |
528 case Ctrl_F: | 525 case Ctrl_F: |
529 wingotofile: | 526 wingotofile: |
532 ptr = grab_file_name(Prenum1, &lnum); | 529 ptr = grab_file_name(Prenum1, &lnum); |
533 if (ptr != NULL) | 530 if (ptr != NULL) |
534 { | 531 { |
535 tabpage_T *oldtab = curtab; | 532 tabpage_T *oldtab = curtab; |
536 win_T *oldwin = curwin; | 533 win_T *oldwin = curwin; |
537 # ifdef FEAT_GUI | 534 #ifdef FEAT_GUI |
538 need_mouse_correct = TRUE; | 535 need_mouse_correct = TRUE; |
539 # endif | 536 #endif |
540 setpcmark(); | 537 setpcmark(); |
541 if (win_split(0, 0) == OK) | 538 if (win_split(0, 0) == OK) |
542 { | 539 { |
543 RESET_BINDING(curwin); | 540 RESET_BINDING(curwin); |
544 if (do_ecmd(0, ptr, NULL, NULL, ECMD_LASTL, | 541 if (do_ecmd(0, ptr, NULL, NULL, ECMD_LASTL, |
557 } | 554 } |
558 } | 555 } |
559 vim_free(ptr); | 556 vim_free(ptr); |
560 } | 557 } |
561 break; | 558 break; |
562 #endif | |
563 | 559 |
564 #ifdef FEAT_FIND_ID | 560 #ifdef FEAT_FIND_ID |
565 // Go to the first occurrence of the identifier under cursor along path in a | 561 // Go to the first occurrence of the identifier under cursor along path in a |
566 // new window -- webb | 562 // new window -- webb |
567 case 'i': // Go to any match | 563 case 'i': // Go to any match |
635 // Execute the command right here, required when | 631 // Execute the command right here, required when |
636 // "wincmd g}" was used in a function. | 632 // "wincmd g}" was used in a function. |
637 do_nv_ident('g', xchar); | 633 do_nv_ident('g', xchar); |
638 break; | 634 break; |
639 | 635 |
640 #ifdef FEAT_SEARCHPATH | |
641 case 'f': // CTRL-W gf: "gf" in a new tab page | 636 case 'f': // CTRL-W gf: "gf" in a new tab page |
642 case 'F': // CTRL-W gF: "gF" in a new tab page | 637 case 'F': // CTRL-W gF: "gF" in a new tab page |
643 cmdmod.cmod_tab = tabpage_index(curtab) + 1; | 638 cmdmod.cmod_tab = tabpage_index(curtab) + 1; |
644 nchar = xchar; | 639 nchar = xchar; |
645 goto wingotofile; | 640 goto wingotofile; |
646 #endif | 641 |
647 case 't': // CTRL-W gt: go to next tab page | 642 case 't': // CTRL-W gt: go to next tab page |
648 goto_tabpage((int)Prenum); | 643 goto_tabpage((int)Prenum); |
649 break; | 644 break; |
650 | 645 |
651 case 'T': // CTRL-W gT: go to previous tab page | 646 case 'T': // CTRL-W gT: go to previous tab page |
711 case '>': | 706 case '>': |
712 case '<': | 707 case '<': |
713 #if defined(FEAT_QUICKFIX) | 708 #if defined(FEAT_QUICKFIX) |
714 case '}': | 709 case '}': |
715 #endif | 710 #endif |
716 #ifdef FEAT_SEARCHPATH | |
717 case 'f': | 711 case 'f': |
718 case 'F': | 712 case 'F': |
719 case Ctrl_F: | 713 case Ctrl_F: |
720 #endif | |
721 #ifdef FEAT_FIND_ID | 714 #ifdef FEAT_FIND_ID |
722 case 'i': | 715 case 'i': |
723 case Ctrl_I: | 716 case Ctrl_I: |
724 case 'd': | 717 case 'd': |
725 case Ctrl_D: | 718 case Ctrl_D: |