|
1 | 1 | local M = { |
2 | | - debug = false, |
3 | | - jdtls_name = "jdtls", |
4 | | - options = { |
5 | | - show_guides = true, |
6 | | - show_path_details = true, |
7 | | - auto_close = false, |
8 | | - width = 32, |
9 | | - relative_width = true, |
10 | | - show_numbers = false, |
11 | | - show_relative_numbers = false, |
12 | | - preview_bg_highlight = "Pmenu", |
13 | | - winblend = 0, |
14 | | - autofold_depth = 99, |
15 | | - fold_markers = { "", "" }, |
16 | | - position = "right", |
17 | | - wrap = false, |
18 | | - hierarchical_view = true, |
19 | | - keymaps = { -- These keymaps can be a string or a table for multiple keys |
20 | | - open_file = "o", |
21 | | - close = { "<Esc>", "q" }, |
22 | | - show_help = "?", |
23 | | - toggle_preview = "K", |
24 | | - fold = "h", |
25 | | - unfold = "l", |
26 | | - fold_all = "W", |
27 | | - unfold_all = "E", |
28 | | - fold_reset = "R", |
29 | | - }, |
30 | | - symbols = { |
31 | | - Workspace = { icon = "", hl = "@text.uri" }, |
32 | | - Project = { icon = "", hl = "@text.uri" }, |
33 | | - PackageRoot = { icon = "", hl = "@text.uri" }, |
34 | | - Package = { icon = "", hl = "@namespace" }, |
35 | | - PrimaryType = { icon = "", hl = "@type" }, |
36 | | - CompilationUnit = { icon = "", hl = "@text.uri" }, |
37 | | - ClassFile = { icon = "", hl = "@text.uri" }, |
38 | | - Container = { icon = "", hl = "@text.uri" }, |
39 | | - Folder = { icon = "", hl = "@method" }, |
40 | | - File = { icon = "", hl = "@method" }, |
41 | | - |
42 | | - CLASS = { icon = "", hl = "@class" }, |
43 | | - ENUM = { icon = "", hl = "@enum" }, |
44 | | - INTERFACE = { icon = "", hl = "@interface" }, |
45 | | - JAR = { icon = "", hl = "@conditional" }, |
46 | | - }, |
47 | | - symbol_blacklist = {}, |
48 | | - }, |
| 2 | + async = false, |
| 3 | + jdtls_name = "jdtls", |
| 4 | + options = { |
| 5 | + show_guides = true, |
| 6 | + show_path_details = true, |
| 7 | + auto_close = false, |
| 8 | + width = 32, |
| 9 | + show_numbers = false, |
| 10 | + show_relative_numbers = false, |
| 11 | + preview_bg_highlight = "Pmenu", |
| 12 | + winblend = 0, |
| 13 | + fold_markers = { "", "" }, |
| 14 | + position = "right", |
| 15 | + wrap = false, |
| 16 | + hierarchical_view = true, |
| 17 | + keymaps = { -- These keymaps can be a string or a table for multiple keys |
| 18 | + open_file = "o", |
| 19 | + close = { "<Esc>", "q" }, |
| 20 | + show_help = "?", |
| 21 | + toggle_preview = "K", |
| 22 | + fold = "h", |
| 23 | + unfold = "l", |
| 24 | + fold_reset = "R", |
| 25 | + }, |
| 26 | + symbols = { |
| 27 | + CLASS = { icon = "", hl = "@class" }, |
| 28 | + ENUM = { icon = "", hl = "@enum" }, |
| 29 | + INTERFACE = { icon = "", hl = "@interface" }, |
| 30 | + JAR = { icon = "", hl = "@conditional" }, |
| 31 | + }, |
| 32 | + symbol_blacklist = {}, |
| 33 | + }, |
49 | 34 | } |
50 | 35 | M.setup = function(config) |
51 | | - if config then |
52 | | - M = vim.tbl_extend("force", M, config) |
53 | | - end |
| 36 | + if config then |
| 37 | + M = vim.tbl_extend("force", M, config) |
| 38 | + end |
54 | 39 | end |
55 | 40 |
|
56 | 41 | function M.has_numbers() |
57 | | - return M.options.show_numbers or M.options.show_relative_numbers |
| 42 | + return M.options.show_numbers or M.options.show_relative_numbers |
58 | 43 | end |
59 | 44 | local function has_value(tab, val) |
60 | | - for _, value in ipairs(tab) do |
61 | | - if value == val then |
62 | | - return true |
63 | | - end |
64 | | - end |
| 45 | + for _, value in ipairs(tab) do |
| 46 | + if value == val then |
| 47 | + return true |
| 48 | + end |
| 49 | + end |
65 | 50 |
|
66 | | - return false |
| 51 | + return false |
67 | 52 | end |
68 | 53 |
|
69 | 54 | function M.is_symbol_blacklisted(kind) |
70 | | - if kind == nil then |
71 | | - return false |
72 | | - end |
73 | | - return has_value(M.options.symbol_blacklist, kind) |
| 55 | + if kind == nil then |
| 56 | + return false |
| 57 | + end |
| 58 | + return has_value(M.options.symbol_blacklist, kind) |
74 | 59 | end |
75 | 60 |
|
76 | 61 | function M.show_help() |
77 | | - print("Current keymaps:") |
78 | | - print(vim.inspect(M.options.keymaps)) |
| 62 | + print("Current keymaps:") |
| 63 | + print(vim.inspect(M.options.keymaps)) |
79 | 64 | end |
80 | 65 |
|
81 | 66 | function M.get_split_command() |
82 | | - if M.options.position == "left" then |
83 | | - return "topleft vs" |
84 | | - else |
85 | | - return "botright vs" |
86 | | - end |
| 67 | + if M.options.position == "left" then |
| 68 | + return "topleft vs" |
| 69 | + else |
| 70 | + return "botright vs" |
| 71 | + end |
87 | 72 | end |
88 | 73 | function M.get_window_width() |
89 | | - if M.options.relative_width then |
90 | | - return math.ceil(vim.o.columns * (M.options.width / 100)) |
91 | | - else |
92 | | - return M.options.width |
93 | | - end |
| 74 | + return M.options.width |
94 | 75 | end |
95 | 76 | return M |
0 commit comments