209 Commits

Author SHA1 Message Date
feadb3b3a6 Quick Typo Fix. (#901) 2025-06-03 08:41:55 -05:00
1d22809dbe Higher tolerance for splitting tag line (#895) 2024-11-11 07:22:14 -06:00
1c5a358f0b This adds support for controlling display of suffix/prefix (#893)
* This adds support for controlling display of suffix/prefix

This adds the `g:tagbar_show_prefix` and `g:tagbar_show_suffix` options. These will help control if the prefix info and/or suffix info is printed in the tagbar window for the tag.

This is just test code for now.

* Correct the `show_prefix` behavior so it has proper whitespacing
2024-11-05 08:10:19 -06:00
12edcb5944 Update tagbar.txt to fix typo (#868)
Fixes #867
2024-01-26 12:46:24 -06:00
a98d4f07c9 Add support for biblatex (#861)
Fixes #856

Note: VIM does not have a known file extension to differentiate between .bib and a BibLaTeX file. From what I can see, there is no common file-extension for a BibLaTeX file, so a custom filetype configuration will be needed in vim to differentiate between the two.
2023-09-21 09:27:46 -05:00
6c3e15ea4a Accommodate packagers with tagged release; using HEAD still recommended 2022-11-04 14:08:31 +03:00
8afd6797e8 Merge remote-tracking branch 'origin/master' 2022-11-04 14:06:02 +03:00
eab609f535 Accommodate packagers with tagged release; using HEAD still recommended 2022-11-04 12:44:55 +03:00
87afc291ee Update the autoclose_netrw default value based on community feedback (#827)
Changing the default value of g:tagbar_autoclose_netrw to 0 based on community feedback. More people seem to be in favor of having this value as false as a default.
2022-08-09 08:51:45 -05:00
a398dca223 Doc update for #825 - BufReadPre instead of BufReadPost for g:tagbar_ignore (#826)
* Fix for #825 - doc update

Closes #825

Doc update for `g:tagbar_ignore` to switch from `BufReadPost` to
`BufReadPre` for large files.

Also fix vint issue

* Fix merge issue

* Fix merge issue... again

* Fix merge issue... again
2022-08-08 08:23:46 -05:00
8e97021f74 Add autoclose_netrw configuration option (#822)
Closes #821

This will add the `autoclose_netrw` configuration option. If set to 1
this will close out of vim if tagbar and netrw (or nerdtree) are the
only remaining windows. If set to 0, then this will leave the netrw (or
nerdtree) window if that is the only remaining window once tagbar is
closed.
2022-08-08 07:50:28 -05:00
ccee72f1d1 Correct variable name in help docs, closes #809 2022-04-07 21:05:38 +03:00
2137c14370 Fixes #811, #799: Add language specific regex support for custom tag kinds (#812)
* Add language specific regex support for custom tag kinds

* Fix typo in example
2022-03-28 08:56:27 -05:00
3188ab1ee8 use g:tagbar_highlight_method as default in tagbar#currenttag and forward search method from :TagbarCurrentTag (#803)
* allow to specify {search-method} in :TagbarCurrentTag command

* tagbar#currenttag now uses g:tagbar_highlight_method as default search method
2022-01-11 10:41:32 -06:00
as
0441c1c6d9 Add support of TagbarOpen arguments for TagbarToggle (#800) 2021-12-08 16:49:40 -06:00
bb8ca482a5 Highlight key-map options in help file (#788)
Signed-off-by: Daniel J. Perry <dperry45@gatech.edu>
2021-08-24 09:16:57 -05:00
cd74f18d10 Add JumpToNearbyTag functionality (#780)
* Add JumpToNearbyTag functionality

Closes #779

Updated functions:

`s:GetNearbyTag()` - Allow for a direction parameter to be passed into
the routine. This will allow for a forward or backward search. It will
default to a backward search line the current behavior if the
`a:direction` parameter is not used.

`s:JumpToTag()` - Allow for an optional parameter to be passed in to
specify the tag instead of using the tag under the cursor on the current
line. This also allows this routine to be executed from the file window
instead of the tagbar window. Assume `autoclose=0` if passing in the tag.

Add new functions:

`s:JumpToNearbyTag()` - This routine will do a forward or backward search
for the nearst tag using the `GetNearbyTag()` with the new direction
field, then call the `JumpToTag()` with the tag we found.

`tagbar#jumpToNextTag()` - New public facing wrapper routine around the
`JumpToNearbyTag()` routine. Optionally take in `a:lnum` and
`a:search_method` to be used in other routines. If `a:lnum` is not
present, then the line number will search from the next or previous line
depending on the `a:direction` value.

TODO:
- [ ] Still need to write up the documentation for this.
- [ ] Possibly look at providing default keymap. Currently this can be
  done using a custom definition in `.vimrc`.

* Add documentation and fix lazy scroll

Added documentation for this feature
Corrected the lazy scroll behavior when the next/prev tag is visible
Use the existing `w:autoclose` if set, else default to 0.

* Fix argument ordering

Correct the argument ordering and numbering for the jumpToNearbyTag()
routine.
Add documentation example for the 'nearest' search-method.
Rename jumpToNextTag() to jumpToNearbyTag() to be more inline with the
other routines.

* remove debug

* Fix current line processing

In the event there is a tag on the immediately previous/next line, then
the GetNearbyTag will return that tag even if the scoped-stl
search-method is set.

* Cleanup optional argument initialization

* Update tagbar#jumpToNearbyTag() - remove lnum and add flags parameter

Changes to the tagbar#jumpToNearbyTag() routine to allow more
flexibility. Removing the optional lnum parameter as this likely will
not be needed and could actually cause confusion in its use. Add a flags
field so different options can be set such as the 's':'scroll_offset'
option.
2021-08-04 09:26:06 -05:00
23ea1961b9 Fix for #784 - add additional option for g:tagbar_wrap (#785)
Adding additional setting to `g:tagbar_wrap` to allow for more granular
control of the `linebreak` functionality. If set to 1, linebreak will
also be set. If set to 2, linebreak will be disabled.
2021-08-02 09:59:38 -05:00
a0a5714910 Add ability to fold/unfold headers on <CR> in tagbar window (#781)
Closes #778

Add to the `JumpToTag()` routine so if the current line does not contain
a valid tag, then it will check if the line is foldable, and if so will
either call the `OpenFold()` or `CloseFold()` as necessary. This allows
the `<Enter>` key to be used to toggle a foldable header in the tagbar
window.
2021-07-27 08:01:05 -05:00
2fb3171ed7 Fix incorrect example for g:tagbar_status_func (#752) 2021-02-12 12:24:27 -06:00
16f3f9b77b Accommodate packagers with tagged release; using HEAD still recommended 2021-01-21 07:54:15 +03:00
e6e6582739 Add g:tagbar_no_autocmds option to disable almost all autocmds (#688)
* Closed #578 - Add `g:tagbar_no_autocmds` option to disable almost all autocommands

* Rework to be more streamlined
2021-01-12 07:41:38 -06:00
2a36ad79a7 Add TagbarJump (#515)
Co-authored-by: Sundström Valter <mail@valter.nu>
Co-authored-by: David Hegland <david.hegland@broadcom.com>
2021-01-12 07:41:44 +03:00
6f02f1f852 Add g:tagbar_highlight_follow_insert option (#725)
This adds an option making the highlight in the Tagbar follow the cursor
in insert mode as well. This feature is guarded behind an option because
it may introduce some delay in the input.

GitHub: closes #724
2021-01-11 07:24:49 -06:00
52ec4e03f3 Feature Request: Ignore anonymous option (#727)
Closes #726

New option `g:tagbar_ignore_anonymous` to ignore any tags with __anon in
the tag name. CTAGS will print any unlabeled tags with the __anon###
name with a custom hash. This option will ignore those tags and they
will not be visible in the tagbar window. This could potentially result
in unknown behavior when a parent object has been ignored in this way.
However these tags should then fall under the default hierarchy for that
particular kind.
2021-01-06 15:24:33 +03:00
5f912e6ad0 Add tagbar#IsOpen() helper routine (#728)
Closes #717

Add a `tagbar#IsOpen()` helper routine to check if the tagbar window is open or not.
2021-01-06 15:23:55 +03:00
ed1bbe554d Use the same example hotkey in docs as in README.md (#712) 2020-11-23 12:55:24 +03:00
68a77323cb Add option for g:tagbar_highlight_method (#709)
* Add option for g:tagbar_highlight_current_tag

Closes #708

Add option for g:tagbar_highlight_current_tag which will allow
highlighting of tags on the current line in addition to highlighting the
scoped tags. Reverts the behavior added in #638 to the default from
before that commit

* Rework to allow direct configuration of highlight method

* Address review comments
2020-11-13 07:29:07 -06:00
6eadc15054 Add g:tagbar_jump_lazy_scroll option. (#705)
* Add g:tagbar_jump_lazy_scroll option.

When this option is on, a jump to a tag will only cause the
window to scroll if the tag line is not already visible on
the window.  If it is visible, the cursor will simply move
to that line without scrolling the window.  If the tagline
is not visible then the window will be scrolled as in current
behavior (according to the g:tagbar_jump_offset option).

Fixes #703

* Factor our new logic into a function.

* Add jump target line to doc.
2020-11-10 16:07:57 -06:00
bd0c32242d Setup syntax highlighting group for tag line numbers 2020-11-03 11:12:13 +03:00
55b8ffa85c Scoped kinds (#696)
* Add support for scope
Closes #508, #516

Add --fields=e (end) to the ctags field types to look for the end of the scope.
Update the `s:GetNearbyTag()` routine to use this scope to look for the correct tag.

* Update comment to call out exuberant ctags not supporting the -e option

* Update autoload/tagbar.vim

Co-authored-by: Caleb Maclennan <caleb@alerque.com>

* Optimize nearesttag search, add option for scoped-stl search method

Co-authored-by: Caleb Maclennan <caleb@alerque.com>
2020-11-02 15:15:55 -06:00
601b5c0073 Add tag datatype (#698)
Closes #680

Add `g:tagbar_show_data_type` field to show the tag datatype next to the tag in the tagbar window
This uses the `--fields=t` field to get the datatype from ctags. If not found, then it will attempt to derive the datatype by extracting all the output from the `pattern` preceeding the tag name.

More testing is needed on other languages. So far this has been stable with C / C++ files parsing the datatype from ctags output. It has also been tested with Java files for the inferred datatype by parsing the pattern line and pulling out everything prior to the tag.
2020-11-02 15:06:40 -06:00
d55c16e875 Add g:tagbar_jump_offset configuration (#695)
Closes #504

Add a new `g:tagbar_jump_offset` value which will control the tag jump location relative to the center of the screen.
2020-10-29 12:58:17 -05:00
00841836b4 Add g:tagbar_scrolloff configuration (#692)
* Add g:tagbar_scroll_offset configuration
Closes #564

Add option for `g:tagbar_scrolloff` to issue a `setlocal scrolloff=#` during tagbar window init

* Address review comments
2020-10-29 10:36:47 -05:00
7a54a7d4ae Document how to use relative sizes in g:tagbar_width (#689) 2020-10-28 22:24:17 +03:00
8efec2509b shane: compact tag line# should be good enough if user set it (#687) 2020-10-28 10:17:50 -05:00
aa8c592201 Help visibility (#686)
Closes #410

Add `g:tagbar_help_visibility` option to always show the help dialog
2020-10-27 14:14:39 -05:00
469c4b3188 Add g:tagbar_show_tag_count option (#685)
* Add g:tagbar_show_tag_count option

Closes #290

This option will show the tag kind count next to the kind label in the
tagbar window.

* Address review comments
2020-10-27 09:18:30 -05:00
0d1c6442d9 Add option to print the tag linenumber in the tagbar window (#684)
* Add option to print the tag linenumber in the tagbar window

* Update documentation markup

* Change variable name to g:tagbar_show_tag_linenumbers to be more consistent with other variables

* Fix documentation
2020-10-27 08:37:33 -05:00
bc48b8b84b Scoped Highlighting (#683)
* Scoped highlighting fix
Attempt to change the scoped highlighting of the tagbar window. This
will now look only for 'stl' tag types when looking for the nearby tag
when looking to highlight. It does however take into account if the
cursor is on the same line as the tag and highlights it then as well.

* Add additional documentation

* Add documentation for tagbar#printfileinfo() debug routine
2020-10-26 10:19:14 -05:00
2a9270cb24 sq: would mess if set key mapping to '' (#675)
Co-authored-by: Caleb Maclennan <caleb@alerque.com>
2020-10-24 10:17:11 +03:00
05bc912c76 Update doc to reflect new possible values for tagbar_compact. 2020-10-16 14:16:54 -04:00
9e2e5d93b4 Merge branch 'master' into large-file-handling 2020-09-23 11:47:24 -05:00
64730d27a9 Added fsize calculation in fileinfo so better tracking can be used to display in tagbar window 2020-09-23 11:45:02 -05:00
8d17340295 Add g:tagbar_visibility_symbols (#660) 2020-09-23 13:43:05 +03:00
5339b4e8bd Add g:tagbar_scopestrs (#661)
Allows mapping scope suffixes (e.g. 'function') to user-defined values.
2020-09-23 13:02:34 +03:00
88be6d9a4c Fix syntax in example text for new option 2020-09-21 08:25:57 -05:00
22df1b87af Fix for #647: Add g:tagbar_wrap option 2020-09-21 08:24:01 -05:00
14a86de04b Update to use file size instead of line count 2020-09-16 12:15:48 -05:00
be67ff7ae7 Add option to not trigger update on large files 2020-09-14 15:15:39 -05:00