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

Add support for TCL and fix some bugs #366

Merged
merged 3 commits into from
Sep 14, 2020

Conversation

CeleritasCelery
Copy link
Contributor

This PR adds support for TCL and fixes some bugs I found along the way. I can split it into multiple PR's if needed, but my TCL code does not work without the bug fixes here.

bugs:

  • getting the :left and :right of a symbol does not work correctly when the symbol is at the start of the line.
    You can see this with
(dumb-jump-get-point-context "foo bar baz" "foo" 0) => (:left "f" :right "bar baz")

notice that the left side is "f", which is not correct. I also took the chance to simplify the code and update the tests.

  • Git grep does not work if not file extensions are specified

Currently if no file extensions are specified then git grep will not be given a path and will therefore only search from the current directory instead of the root. So in that case we add the magic path :/ to search from the project root. Note that this only works in Git versions greater then 1.7.6.

Since the current implementation always adds one before returning it can never
return 0, even when the start of the symbol is at the start of the line. This
means that if the symbol is at the start of the line the :left side will be the
first letter of the symbol instead of empty.
Currently if no file extensions are specified then git grep will not be given a
path and will therefore only search from the current directory instead of the
root. So in that case we add the magic path (:/) to search from the project
root. Note that this only works in Git versions greater then 1.7.6.
@jacktasia
Copy link
Owner

Thanks for opening this! I just had a small question above

Copy link
Owner

@jacktasia jacktasia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jacktasia jacktasia merged commit fbbe6b0 into jacktasia:master Sep 14, 2020
jobor pushed a commit to jobor/dumb-jump that referenced this pull request Feb 18, 2025
* Add support for tcl

* Fix issue when symbol is at the start of line

Since the current implementation always adds one before returning it can never
return 0, even when the start of the symbol is at the start of the line. This
means that if the symbol is at the start of the line the :left side will be the
first letter of the symbol instead of empty.

* Fix issue with git grep when no file extensions are specified

Currently if no file extensions are specified then git grep will not be given a
path and will therefore only search from the current directory instead of the
root. So in that case we add the magic path (:/) to search from the project
root. Note that this only works in Git versions greater then 1.7.6.
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.

3 participants