Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide filter-buffer-substring-function in gfm-view-mode #493

Closed
wants to merge 2 commits into from
Closed

Provide filter-buffer-substring-function in gfm-view-mode #493

wants to merge 2 commits into from

Conversation

muffinmad
Copy link

Description

gfm-view-mode is used by eglot to show symbol information in markdown format. E.g. the LSP server send something like this as the documentation:

```python
foo(bar=None):
```

```
Docstring for foo
```

eglot-help-at-point will show this text nicely fontified by gfm-view-mode.

The first line (which usually is the signature info) of that text is also used as the eldoc message to show in the echo area. The problem is that the first line is actually invisible codeblock marker.

This PR provides the function that return buffer substring without codeblock markers and can be used as value of the filter-buffer-substring-function variable. This way fontified signature info can be shown in the echo area.

Similar behavior is used by the diff-mode and the backtrace-mode.

Thanks!

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves an existing feature)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have updated the documentation in the README.md file if necessary.
  • I have added an entry to CHANGES.md.
  • I have added tests to cover my changes.
  • All new and existing tests passed (using make test).

@syohex
Copy link
Collaborator

syohex commented May 26, 2020

@muffinmad Thanks for PR. However I suppose this is not enough

  • filter-buffer-substring-function should be set both markdown-view-mode and gfm-view-mode
  • It should filter not only code block(triple backticks) but also other invisible characters

I have sent PR #494. How about it ?

@muffinmad
Copy link
Author

I have sent PR #494. How about it ?

Perfect! Thanks!

@muffinmad
Copy link
Author

Closing in favour of #494

@muffinmad muffinmad closed this May 26, 2020
@syohex
Copy link
Collaborator

syohex commented May 26, 2020

Thanks for checking. I have merged #494. Please check latest version.

@muffinmad
Copy link
Author

Thanks for checking. I have merged #494. Please check latest version.

Works as expected. Great work! Thanks!

@muffinmad muffinmad deleted the feat/filter-buffer-substring branch May 26, 2020 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants