* 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
* 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.
* Add linenr protection into getPrototype
Closes#706
Add protection to not go beyond the last line in the file when calling the `s:getPrototype()` routine. This occurs when there is an `=` character in the tag prototype. For example in a python tag with a parameter line this: `some_function(arg1, optional_arg_2=False)`
* Fix issue with python prototypes that can include `=` character in the argument list
* 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>
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.
* 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
* 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
* 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
Perform a has_key() check prior to referencing the dictionary to ensure
the dictionary has a valid key for the specified kind.
Note: When an unknown kind is found, it can mess up the tag highlighting
in the tagbar window. Not sure why this is occurring.
* Fix for window positioning
With default case having multiple vertically split windows, the tagbar
window should open on the far right of the screen. When the feature in
pull-request 630 was added, this behavior changed to open the tagbar
window relative to the current window. This commit will fix that by
allowing direct usage of the vim split options.
Validated the following cases for the old default values. These all
still behave the same way as prior to pull-request 630 when the tagbar
is activated in the `active` window shown in the below examples:
```
" No options
+-----------------------------------+
| preview |
+--------+--------+--------+--------+
| edit | edit | edit | tagbar |
| | active | | |
+--------+--------+--------+--------+
" tagbar on left, preview above
let g:tagbar_left = 1
+-----------------------------------+
| preview |
+--------+--------+--------+--------+
| tagbar | edit | edit | edit |
| | | active | |
+--------+--------+--------+--------+
" tagbar on bottom, preview to right of tagbar
let g:tagbar_vertical = 10
+--------+---------------+--------+
| edit | edit | edit |
| | active | |
| +-----+---------+ |
| | tag | preview | |
+--------+-----+---------+--------+
" tagbar on top, preview to the right of tagbar
let g:tagbar_left = 1
let g:tagbar_vertical = 10
+--------+-----+---------+--------+
| edit | tag | preview | edit |
| +-----+---------+ |
| | edit | |
| | active | |
+--------+---------------+--------+
```
New values also all validated using the following:
```
" Behaves the same as no options
let g:tagbar_position = 'right'
" Behaves the same as g:tagbar_left = 1
let g:tagbar_position = 'left'
" Behaves the same as g:tagbar_vertical = <#>
let g:tagbar_position = 'bottom'
" Behaves the same as g:tagbar_left = 1 | g:tagbar_vertical = <#>
let g:tagbar_position = 'top'
```
* #650 - Fix typo in doc/tagbar.txt for g:tagbar_height option
In C++, the name of the destructor of a class starts with a
tidle(~) which is special when the option 'magic' is set. This
will cause an error when jumping to a destructor. Call search()
in "very nomagic" environment can solve this problem no matter the
option 'magic' is set or not.
New configuration option for g:tagbar_position that will supercede g:tagbar_left. This option allows for new values for 'top', 'bottom', 'left' and 'right' (default:'right') to position the Tagbar window.
New configuration option for g:tagbar_height that will supercede g:tagbar_vertical. This option is used to set the Tagbar window height when the window is split using the 'top' or 'bottom' position.
New configuration option for g:tagbar_no_status_line. This option will disable any Tagbar status line updates in the event another plugin is controlling the status line. This prevents Tagbar from changing the status line when Tagbar is not the active window.
Co-authored-by: David Hegland <david.hegland@broadcom.com>
If vim is launched from the Elvish shell, then fall back to using the
bourne shell (sh) or a bourne compatible shell when calling
{universal/exuberant-}ctags.
Signed-off-by: Adam Jimerson <vendion@gmail.com>
There is no spoon. My testing last night was flawed because I had a typo
in my RC file that was complicating matters. In seems the syntax fix was
all this needed to work okay, not disabling the feature