rmuslimov / browse-at-remote

Browse target page on github/bitbucket from emacs buffers
232 stars 53 forks source link

Line numbers in URL even though I didn't select any line #64

Closed FrostyX closed 4 years ago

FrostyX commented 4 years ago

I believe there is a bug with appending line numbers even when we don't want them. Or maybe I have just different expectations, in that case, please just close the issue.

I would expect that if

  1. I have no line visually selected, do M-x bar-browse, no line number should be in the link
  2. I have one line (or some text on one line) visually selected, the line number should be attached to the link
  3. I have multiple lines selected, the range of line numbers should be attached to the link

Both 2 and 3 works as expected, but 1 not. Even though I have nothing selected, line number appears in the link.

FrostyX commented 4 years ago

If this is the expected behavior, please just let me know how to browse a file without any specified line number.

rmuslimov commented 4 years ago

Before this commit https://github.com/rmuslimov/browse-at-remote/commit/771a3079e27f397d2f5a9470b945980fa68ee048, I feel like it was working as you expected. However, my personal feeling that it should be better with explicit line number added. You can adjust defcustom as mentioned in my commit and get behaviour as you prefer. Thanks for pointing to this issue!

FrostyX commented 4 years ago
(setq browse-at-remote-add-line-number-if-no-region-selected nil)

Works like a charm. Thank you.