Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ci/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ if(NOT WIN32)
--suppress=noOperatorEq --suppress=ignoredReturnValue
--suppress=unknownMacro --suppress=unmatchedSuppression
--suppress=unusedScopedObject --suppress=unusedFunction
--suppress=shadowArgument --suppress=shadowVariable ${SRCS}
--suppress=shadowFunction --suppress=shadowArgument
--suppress=functionStatic --suppress=shadowVariable ${SRCS}
COMMENT "cppcheck"
VERBATIM
)
Expand Down
14 changes: 7 additions & 7 deletions src/del/dirctrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ wex::del::dirctrl::dirctrl(frame* frame, const data::window& data)
data::dir::type_t().set(data::dir::FILES));
},
ID_EDIT_OPEN},
{[=, this](wxCommandEvent& event)
{[=, this](const wxCommandEvent& event)
{
on_selected_paths(
[=, this](const std::vector<path> p)
[=, this](const std::vector<path>& p)
{
build(path_lexer(p[0]));
});
Expand Down Expand Up @@ -114,7 +114,7 @@ wex::del::dirctrl::dirctrl(frame* frame, const data::window& data)
[=, this](wxTreeEvent& event)
{
on_selected_paths(
[=, this](const std::vector<path> p)
[=, this](const std::vector<path>& p)
{
if (const auto& fn(p[0]); !fn.file_exists() && fn.dir_exists())
{
Expand All @@ -140,10 +140,10 @@ wex::del::dirctrl::dirctrl(frame* frame, const data::window& data)

Bind(
wxEVT_TREE_ITEM_MENU,
[=, this](wxTreeEvent& event)
[=, this](const wxTreeEvent& event)
{
on_selected_paths(
[=, this](const std::vector<path> p)
[=, this](const std::vector<path>& p)
{
const wex::path_lexer filename(p[0]);

Expand Down Expand Up @@ -199,10 +199,10 @@ wex::del::dirctrl::dirctrl(frame* frame, const data::window& data)

Bind(
wxEVT_TREE_SEL_CHANGED,
[=, this](wxTreeEvent& event)
[=, this](const wxTreeEvent& event)
{
on_selected_paths(
[=, this](const std::vector<path> p)
[=, this](const std::vector<path>& p)
{
log::status() << p[0];
});
Expand Down
6 changes: 3 additions & 3 deletions src/ex/global-env.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ bool wex::global_env::process(addressrange_mark& am, const block_lines& block)
m_ex->command_parsed_data().text().ends_with('$') ?
1 :
0));
bool skip = false;
bool skipped = false;

while (m_lines_skip.contains(line) &&
line < m_ex->get_stc()->get_line_count())
Expand All @@ -211,11 +211,11 @@ bool wex::global_env::process(addressrange_mark& am, const block_lines& block)
return false;
}

skip = true;
skipped = true;
line++;
}

if (skip)
if (skipped)
{
return true;
}
Expand Down
16 changes: 10 additions & 6 deletions src/lsp/diagnostics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// Copyright: (c) 2026 Anton van Wezenbeek
////////////////////////////////////////////////////////////////////////////////

#include <algorithm>
#include <iterator>

#include <wex/lsp/diagnostics.h>

namespace wex
Expand Down Expand Up @@ -53,20 +56,21 @@ diagnostics_t diagnostics::get_line(const std::string& uri, int line) const
std::vector<diagnostic_item> result;
const auto& diags = get(uri);

for (const auto& diag : diags)
{
if (diag.range.start.line == line || diag.range.end.line == line)
std::ranges::copy_if(
diags,
std::back_inserter(result),
[line](const diagnostic_item& diag)
{
result.push_back(diag);
}
}
return diag.range.start.line == line || diag.range.end.line == line;
});
Comment thread
qodo-code-review[bot] marked this conversation as resolved.

return result;
}

std::vector<std::string> diagnostics::get_uris() const
{
std::vector<std::string> uris;
uris.reserve(m_diagnostics.size());

for (const auto& pair : m_diagnostics)
{
Expand Down
Loading