{"action":"created","issue":{"url":"https://api.github.com/repos/sharkdp/bat/issues/388","repository_url":"https://api.github.com/repos/sharkdp/bat","labels_url":"https://api.github.com/repos/sharkdp/bat/issues/388/labels{/name}","comments_url":"https://api.github.com/repos/sharkdp/bat/issues/388/comments","events_url":"https://api.github.com/repos/sharkdp/bat/issues/388/events","html_url":"https://github.com/sharkdp/bat/issues/388","id":375246930,"node_id":"MDU6SXNzdWUzNzUyNDY5MzA=","number":388,"title":"Parameter or flag to scroll to certain line number","user":{"login":"felipesere","id":1850188,"node_id":"MDQ6VXNlcjE4NTAxODg=","avatar_url":"https://avatars0.githubusercontent.com/u/1850188?v=4","gravatar_id":"","url":"https://api.github.com/users/felipesere","html_url":"https://github.com/felipesere","followers_url":"https://api.github.com/users/felipesere/followers","following_url":"https://api.github.com/users/felipesere/following{/other_user}","gists_url":"https://api.github.com/users/felipesere/gists{/gist_id}","starred_url":"https://api.github.com/users/felipesere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felipesere/subscriptions","organizations_url":"https://api.github.com/users/felipesere/orgs","repos_url":"https://api.github.com/users/felipesere/repos","events_url":"https://api.github.com/users/felipesere/events{/privacy}","received_events_url":"https://api.github.com/users/felipesere/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-29T22:41:57Z","updated_at":"2018-10-31T17:34:14Z","closed_at":null,"author_association":"NONE","body":"I want to use `bat` as part of the preview for my `fzf` setup in vim with `ripgrep`.\r\nOne of the shortcuts I am working on is search, which might get a hit somewhere in the middle of the file.\r\n\r\nCurrently,  I can not find a way to tell `bat` which line to center on. So I might get a hit in a bunch of files, scroll through them, and then have to scroll in the preview pane to gage whether its worth opening the file. It would be awesome if I could use the line number that ripgrep finds to drive bat.\r\n\r\nIs that a feature you would consider merging? "},"comment":{"url":"https://api.github.com/repos/sharkdp/bat/issues/comments/434779250","html_url":"https://github.com/sharkdp/bat/issues/388#issuecomment-434779250","issue_url":"https://api.github.com/repos/sharkdp/bat/issues/388","id":434779250,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNDc3OTI1MA==","user":{"login":"sharkdp","id":4209276,"node_id":"MDQ6VXNlcjQyMDkyNzY=","avatar_url":"https://avatars2.githubusercontent.com/u/4209276?v=4","gravatar_id":"","url":"https://api.github.com/users/sharkdp","html_url":"https://github.com/sharkdp","followers_url":"https://api.github.com/users/sharkdp/followers","following_url":"https://api.github.com/users/sharkdp/following{/other_user}","gists_url":"https://api.github.com/users/sharkdp/gists{/gist_id}","starred_url":"https://api.github.com/users/sharkdp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharkdp/subscriptions","organizations_url":"https://api.github.com/users/sharkdp/orgs","repos_url":"https://api.github.com/users/sharkdp/repos","events_url":"https://api.github.com/users/sharkdp/events{/privacy}","received_events_url":"https://api.github.com/users/sharkdp/received_events","type":"User","site_admin":false},"created_at":"2018-10-31T17:34:14Z","updated_at":"2018-10-31T17:34:14Z","author_association":"OWNER","body":"\"Scroll to a certain line number\" is something that the pager (e.g. `less`) would have to do for us.\r\n\r\nI think there are multiple ways to solve this:\r\n\r\n- Use `bat`s `--line-range` option to select a small region around the line number you are interested in. This would probably require a little bit of scripting in your `fzf`-preview script that calls `bat`. See #159 for the original request that was also related to `fzf`-preview. Also see #175 for a follow-up request that is very related to this ticket.\r\n\r\n- Instruct the pager to scroll to a specific line number. With `less`, you could do something like this:\r\n   ```\r\n   bat file.cpp --pager=\"less +300G\"\r\n   ```\r\n   (`--pager` is only available on `master`. With 0.8.0, you'd have to set the `BAT_PAGER` environment variable accordingly)\r\n\r\n- We somehow include this functionality in `bat`. I don't think that would be the best option, because we would still have to instruct the pager to do something, so that would probably also just work for `less`."}}
{"actor":{"display_login":"sharkdp"}}