Commit Graph

97 Commits

Author SHA1 Message Date
daangoossens22
c948263d89 fix: builtin autocommands previewer throws error (#1732) 2022-02-14 17:36:55 +01:00
smhc
991d0127f0 fix: previewer for builtin.builtin (#1583) 2021-12-10 11:44:50 +01:00
Simon Hauser
d0083f9e4c fix: git_branch previewer highlighter error (#1543) 2021-12-05 08:39:16 +01:00
Simon Hauser
a8e9aa58a4 fix: issue when scrollbind is set (#1496) 2021-11-26 22:42:54 +01:00
fdschmidt93
97842abb03 fix: revert buffers previewer (#1400)
* Reverts #1120 many issues arise (mru, highlighting, settings inheritance, ...) when previewing actual buffers
2021-11-04 07:55:32 +01:00
Simon Hauser
a0835edd86 fix: preview title key and a bug with dynamic_title (#1350) 2021-10-20 16:23:26 +02:00
fdschmidt93
ec48777990 fix: stacking highlights in buffer previewer (#1294) 2021-10-04 22:35:22 +02:00
fdschmidt93
a6c7498bdc feat: filetype_hook & improved docs; fix preview partial override (#1273) 2021-09-27 15:24:35 +02:00
Sávio Carlos Martins Costa
87471bc3ff feat: add highlight group: TelescopePreviewMessage (#1286)
* feat: add highlight group: TelescopePreviewMessage

* fix indentation from 4 to 2 spaces
2021-09-27 11:59:05 +02:00
Simon Hauser
41f362006b fix: tags now also support suppercollider tags (#1284) 2021-09-26 12:56:06 +02:00
fdschmidt93
2e7584f1cf fix: stacked hooks in buffer previewer (#1253) 2021-09-17 20:02:56 +02:00
fdschmidt93
7c5b846f6f feat: skip/timeout preview if file cannot be easily previewed (#1231)
* For full configuration, see `:h telescope.defaults.preview`
* Unblocks previewer on binaries, too large files, and files that take too long to read
* Allows toggling treesitter highlighting for buffer_previewer
* Allows to globally opt out of previewer
2021-09-16 23:01:40 +02:00
fdschmidt93
1c35ea319e fix: stale lnum in buffer previewer (#1229)
* fix: lnum to jump to might be stale eg when resuming buffer picker after changes
2021-09-10 13:21:04 +02:00
fdschmidt93
ac42f0c26c fix: clear buffer previewer fully for caching (#1201) 2021-09-02 16:36:08 +02:00
fdschmidt93
97b7e6095f fix: string display for builtin.pickers (#1194) 2021-09-01 21:54:14 +02:00
fdschmidt93
5d37c3ea08 feat: allow caching and resuming picker (#1051)
* expose `cache_picker` in telescope.setup to configure caching, see `:h telescope.defaults.cache_picker`
* add builtin.resume and builtin.pickers picker
2021-09-01 18:17:18 +02:00
Omar Zeghouani
a1a7785acf fix: autocommands cursor outside of buffer (#1157)
Closes #957
2021-09-01 16:12:28 +02:00
fdschmidt93
50e5e86ac3 fix: safer teardown of buffer previewer (#1158) 2021-08-23 20:20:41 +02:00
fdschmidt93
79dc995f82 fix: (terminal) buffer previewer (#1120)
Use existing buffers for buffer previewer to allow previewing special buffer types
2021-08-23 15:27:11 +02:00
zeertzjq
654903fc04 fix: preview the correct man page section (#1076) 2021-08-04 22:19:39 +02:00
Simon Hauser
79644ab677 chore: use stylua for formatting (#1040)
* chore: stylua job and config

* reformat with stylua
2021-07-23 11:42:37 -04:00
fdschmidt93
3f841cb3c5 fix: error from hopping faster than preview (#1006) 2021-07-16 22:24:54 -04:00
anott03
df579bac42 refactor: move from telescope.path to plenary.path (#473)
This will deprecate telescope.path, we will remove it soon. Please move over to plenary.path

Co-authored-by: Simon Hauser <Simon-Hauser@outlook.de>
2021-07-14 19:25:00 +02:00
Simon Hauser
6ac5ee0854 feat: cycle previewers with commit and bcommit already using it (#528)
- new git previewers
- jump to line in bcommit previewer
- vimdiff for bcommits
- dynamic preview window titles
- more previewers documentation

Cycle previewers are not mapped yet. So you need to setup yourself:
```lua
require('telescope').setup {
  defaults = {
    mappings = {
      i = {
        ["<C-s>"] = actions.cycle_previewers_next,
        ["<C-a>"] = actions.cycle_previewers_prev,
      },
    },
  }
}
```

Co-authored-by: Thore Strassburg <thore@weilbier.net>
2021-06-14 21:50:46 +02:00
Michał Nowotnik
22a78a4636 fix: prevents flickering when first loading a buffer preview entry (#797)
There's a slight lag on the first preview loading (during preview buffer creation).
It is not visible the next time user chooses a file for preview because scratch buffer
for the file already exists. This lag *and* setting preview window to display the newly
created buffer before its fully initialized causes a brief flash of blank terminal background.

This change delays setting preview window to display the new preview buffer and consequently
eliminates the flash. It should improve user experience since flickering can be distracting.
2021-05-11 20:16:04 +02:00
Amirreza Askarpour
9fd242db26 feat: add git_stash picker (#800) 2021-05-11 10:20:57 +02:00
Simon Hauser
aefc831735 fix: no longer leaking one buffer previewer in some occasions (#664)
* fix: stop leaking last preview buffer
* fix: formatting for docs
* fix: async check if file is dir or not and
  - fix for in_fast_event when overriding file_maker
* fix: filtering for space in keymaps and fzy
* fix: show correct result numbers when using file_ignore_patterns
* Handle early close. Caused because we actually cleaning up buffers now
* cleanup
* [docgen] Update doc/telescope.txt
2021-03-30 12:32:18 +02:00
Simon Hauser
68c30dd560 fix: only expand if we are not in_fast_event() 2021-03-07 08:41:45 +01:00
Simon Hauser
ca92ec1a83 fix: a lot of small things and adds more customization for caret (#554)
Attention:
prompt_prefix will no longer add a space at the end. So if you still want a space at the end make sure your configuration has one.
The default should not be changed. So if you haven't copied prompt_prefix in your config this doesn't affect you.

Feat:
- prompt prefix does no longer always end with space
- selection_caret configurable. Default: `> `
- result_prefix configurable. Default: `  `
- more actions for git_branches
  - <c-t> does track the branch
  - <c-r> does rebase branch
  - also added delete branch action but not configured. See readme on how to do that

Fixes:
- fix docgen ci
- Better error for lsp_workspace_symbols
- better formatting for CONTRIBUTING.md
- move from systemlist to plenary.job
- git branch now supports checkout on remote branches
2021-02-27 16:26:25 +01:00
Jae-Won Chung
e2696d694a fix: change git previewers from using -P to --no-pager for better compatibility (#558) 2021-02-26 11:54:33 +01:00
Simon Hauser
09d1e3a607 feat: buffer previewers ls is now colorized (#505)
Requires up to date plenary version
2021-02-12 22:30:55 +01:00
Simon Hauser
3a7fa41857 fix: all git builtin respect cwd now (#517) 2021-02-09 18:25:57 +01:00
JINNOUCHI Yasushi
c422d86eb9 feat: add sections opt for man_pages and fix for macos (#413)
:Telescope man_pages sections=3 will only show man pages from section 3
:Telescope man_pages sections=1,2,3 will show man pages from section 1, 2 and 3
2021-02-02 13:23:37 +01:00
TJ DeVries
4e0dfa2e70 fix: dont error if the previewer is not able to set at the current time 2021-01-30 22:57:36 -05:00
Corentin Brunel
2a5db2f4f1 fix: git branches previewer add nil check to cend (#478)
Co-authored-by: Corentin Brunel <cbrunel@localhost.localdomain>
2021-01-30 10:16:17 +01:00
Alvaro Muñoz
951ede2a70 fix: allow previewer win customization (#460) 2021-01-24 23:53:58 +01:00
elianiva
099910dcd9 fix: escape filename for previewer and action (#456) 2021-01-23 19:35:29 +07:00
Simon Hauser
223ec81774 feat: add vim buffer directory viewer using plenary scandir.ls_async (#421)
feat: git_status (??) now shows file or directory
fix: attempt to index field 'state' (a nil value)
2021-01-22 21:03:39 +01:00
Simon Hauser
d75d9ae428 fix: error message too many open files (#432)
and buffer previewer still "erroring" out for builtin.buffers
2021-01-19 18:28:47 +01:00
Simon Hauser
00e898a1f9 fix: preview for unnamed buffers (#434) 2021-01-15 16:42:26 +01:00
Simon Hauser
e08a5b1331 feat: show git log for remote branches (#428) 2021-01-15 09:27:46 +01:00
Simon Hauser
5592d709c6 refactor file_maker signature and fix scrolling (#412) 2021-01-11 21:10:42 +01:00
Simon Hauser
07f8f3d340 fix: previewer windows fix (#371) 2021-01-11 21:02:24 +01:00
Simon Hauser
a0b37473a9 fix: tags now work with hasktags (#375) 2020-12-31 16:17:09 +01:00
Alvaro Muñoz
e0705b5d4a feat: append mode for previewers.utils.job_maker (#372) 2020-12-30 00:56:12 +01:00
Simon Hauser
1d40ab5ccd feat: All buffer previewers are now async and more config options (#354)
Configure preview window with:
autocmd User TelescopePreviewerLoaded setlocal wrap
autocmd User TelescopePreviewerLoaded setlocal number

file_maker example: Use regex highlighting for certain filetype like `*min.js` because they slow
down things with treesitter highlighter. Just a snippet for tests. We will do an extension :)

local previewers = require('telescope.previewers')
local putils = require('telescope.previewers.utils')
local pfiletype = require('plenary.filetype')

local _bad = { '.*%.min%.js' }
local bad_files = function(filepath)
  for _, v in ipairs(_bad) do
    if filepath:match(v) then
      return true
    end
  end

  return false
end

local new_maker = function(filepath, bufnr, bufname, use_ft_detect, callback)
  if use_ft_detect == nil then use_ft_detect = true end

  if bad_files(filepath) then
    previewers.buffer_previewer_maker(filepath, bufnr, bufname, false, callback)
    local ft = pfiletype.detect(filepath)
    putils.regex_highlighter(bufnr, ft)
  else
    previewers.buffer_previewer_maker(filepath, bufnr, bufname, use_ft_detect, callback)
  end
end

require('telescope').setup {
  defaults = {
    buffer_previewer_maker = new_maker,
  }
}
2020-12-29 21:05:59 +01:00
Simon Hauser
8c90d4855c Refactor previewers (#345) 2020-12-19 16:45:02 +01:00