Comments (7)
Now that I noticed, the CMake path is sus. My best guess is that some autocmd changed the working directory of neovim, I'll check it tomorrow, thanks for your advice
from neovim-cmake.
After some attempting, the CMake part seems to be working, but I still haven't got nui to work.
from neovim-cmake.
I want to integrate the build type selection and build target selection with fzf, and I need to get the targets
The plugin is not tied to picker, it uses vim.ui.select
. You can just install something like https://github.com/stevearc/dressing.nvim and to use FZF or Telescope for target selection.
A function that returns an array of build targets in string
You can reuse any function from the plugin. To get targets use the following:
local ProjectConfig = require('cmake.project_config') -- Import it
local project_config = ProjectConfig.new()
local targets = project_config:get_codemodel_targets()
In case you want to do it yourself.
from neovim-cmake.
I was trying to combine the example you gave me with nui, but I got some problems
/home/supertux/build/linux-debug/.cmake/api/v1/reply is not accessible by the current user!
E5108: Error executing lua ...im/site/pack/packer/start/nui.nvim/lua/nui/menu/init.lua:82: attempt to index field 'size' (a nil value)
stack traceback:
...im/site/pack/packer/start/nui.nvim/lua/nui/menu/init.lua:82: in function 'make_default_prepare_node'
...im/site/pack/packer/start/nui.nvim/lua/nui/menu/init.lua:269: in function 'init'
.../site/pack/packer/start/nui.nvim/lua/nui/object/init.lua:111: in function 'nui_menu'
/home/supertux/.config/nvim/init.lua:526: in function 'CMake_select_target_nui'
[string ":lua"]:1: in main chunk
Unable to find codemodel file
The following is how I did it:
local nui_menu = require('nui.menu')
local nui_event = require('nui.utils.autocmd').event
local function convert_array_to_menu(array)
local menu_items = {}
for _, name in ipairs(array) do
table.insert(menu_items, nui_menu.item(name))
end
return menu_items
end
function CMake_select_target_nui()
local project_config = require('cmake.project_config').new()
local targets = project_config:get_codemodel_targets()
local menu = nui_menu({
border = {
style = "single",
text = {
top = "[Select Target]",
top_align = "center",
},
}
}, {
lines = {
convert_array_to_menu(targets)
}
})
menu:mount()
menu:on(nui_event.BufLeave, menu.menu_props.on_close, { once = true })
end
Is there anything that I didn't do properly? (Sorry I've never coded in lua before)
from neovim-cmake.
I don't see any error caused by my plugin (all comes from nui). And it looks like this error:
/home/supertux/build/linux-debug/.cmake/api/v1/reply is not accessible by the current user!
Indicates that you have permission issues.
from neovim-cmake.
How should I solve the permission issue? Everything seems to work fairly fine when I use the default one that comes with this plugin
from neovim-cmake.
How should I solve the permission issue?
How can I know? Check this folder, maybe it doesn't exist. You need to configure your CMake project first.
from neovim-cmake.
Related Issues (20)
- Allow customizing of CMake executable
- CMake select_target fails with error HOT 2
- No output after CMake Run HOT 3
- Support lazy loading with vim-plug HOT 5
- Provide a suitable command to run `cmake --install [build_dir]` within neovim HOT 5
- Support the :CTest command HOT 1
- Upon coredump (crash) plugin reports 0 return HOT 7
- execute command :CMake run, report err HOT 2
- Support for setting environment variables during launch/debug HOT 3
- Pass build_args while executing build_all command HOT 4
- Add support for CMake presets HOT 3
- Add the ability to run program in built-in terminal HOT 4
- Position of the quickfix window HOT 6
- Questions about dap configurations HOT 2
- Integration with 'trouble.nvim'
- 'CMake build_all' does not respect 'build_args' HOT 1
- Breaking change: after 23a63ffd7b709b0f9f407c47523e9bbe322cde37 HOT 7
- The program is not entering the directory HOT 1
- 'run_dir' is not actually missing by default
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neovim-cmake.