FelipeLema / emacs-counsel-gtags

GNU Global with ivy completion
22 stars 5 forks source link

fix counsel-gtags-dwim when there is only one candidate #25

Closed thanhvg closed 1 year ago

thanhvg commented 3 years ago

otherwise counsel-gtags--select-file will throw error:

split-string: Wrong type argument: stringp, nil

Thanks

FelipeLema commented 3 years ago

hey, this looks good

can you add an unit test for this? I get the feeling I once wrote that (first (car for some reason before. Can't really remember

zealoct commented 3 years ago

Same problem here, this could work. 😀

FelipeLema commented 3 years ago

@thanhvg let me know if you're having trouble adding an unit test

thanhvg commented 3 years ago

Sorry I don't have time to work on the unit test. If anyone can, feel free to take over this PR.

Thanks

Ergus commented 3 years ago

Hi:

It feels like if we need to do a cadr for a latter car there is maybe something wrong. I would prefer to accept this pull request because it is simpler and clear; if a problem is detected then probably the fix needs to be done in counsel-gtags--collect-candidates instead of this function.

FelipeLema commented 1 year ago

closing because unit tests are not going to be added in this PR

if you're reading this and want to add some unit to this change, I'll welcome another PR