Skip to content

Instantly share code, notes, and snippets.

@christianparpart
Created July 21, 2020 14:39
Show Gist options
  • Save christianparpart/e32063f68c2bd92edb79a3ba2a1f0d7e to your computer and use it in GitHub Desktop.
Save christianparpart/e32063f68c2bd92edb79a3ba2a1f0d7e to your computer and use it in GitHub Desktop.
Please apply that to a newly created branch created out of `master` branch.
commit 9ea1b7bbf591ce605d1171b808aa3f68aabe4b40
Author: Rachid <[email protected]>
Date: Tue Jul 21 15:05:12 2020 +0200
[libterminal, terminalview] replace std::bind with lambda
- add cmake package dependency for ubuntu
diff --git a/README.md b/README.md
index 09d703a..4fbdc0d 100644
--- a/README.md
+++ b/README.md
@@ -172,7 +172,7 @@ This is tested on Ubuntu 19.04, but *any* recent Linux with latest C++17 compile
```sh
sudo apt install \
- "g++-9" libfreetype6-dev qtbase5-dev libqt5gui5 extra-cmake-modules \
+ "g++-9" cmake libfreetype6-dev qtbase5-dev libqt5gui5 extra-cmake-modules \
libfontconfig1-dev libharfbuzz-dev
```
diff --git a/src/contour/FileChangeWatcher.cpp b/src/contour/FileChangeWatcher.cpp
index eb65b9b..d642b46 100644
--- a/src/contour/FileChangeWatcher.cpp
+++ b/src/contour/FileChangeWatcher.cpp
@@ -21,7 +21,7 @@ FileChangeWatcher::FileChangeWatcher(FileSystem::path _filePath, Notifier _notif
filePath_{ move(_filePath) },
notifier_{ move(_notifier) },
exit_{ false },
- watcher_{ bind(&FileChangeWatcher::watch, this) }
+ watcher_{ [this]() { watch(); } }
{
}
diff --git a/src/contour/TerminalWindow.cpp b/src/contour/TerminalWindow.cpp
index fa6d38c..36286f1 100644
--- a/src/contour/TerminalWindow.cpp
+++ b/src/contour/TerminalWindow.cpp
@@ -323,7 +323,7 @@ TerminalWindow::TerminalWindow(config::Config _config, string _profileName, stri
terminalView_{},
configFileChangeWatcher_{
config_.backingFilePath,
- bind(&TerminalWindow::onConfigReload, this, _1)
+ [this](FileChangeWatcher::Event event) { onConfigReload(event); }
},
updateTimer_(this)
{
diff --git a/src/terminal/Terminal.cpp b/src/terminal/Terminal.cpp
index c4c0d16..82229d9 100644
--- a/src/terminal/Terminal.cpp
+++ b/src/terminal/Terminal.cpp
@@ -56,7 +56,7 @@ Terminal::Terminal(WindowSize _winSize,
true, // logs trace output by default?
_maxHistoryLineCount
},
- screenUpdateThread_{ bind(&Terminal::screenUpdateThread, this) }
+ screenUpdateThread_{ [this]() { screenUpdateThread(); } }
{
}
diff --git a/src/terminal_view/Renderer.cpp b/src/terminal_view/Renderer.cpp
index 833e176..23310c0 100644
--- a/src/terminal_view/Renderer.cpp
+++ b/src/terminal_view/Renderer.cpp
@@ -161,7 +161,7 @@ uint64_t Renderer::render(Terminal& _terminal,
}
changes = _terminal.preRender(_now);
- _terminal.screen().render(bind(&Renderer::renderCell, this, _1, _2, _3),
+ _terminal.screen().render([this](cursor_pos_t _row, cursor_pos_t _col, Cell const& _cell) { renderCell(_row, _col, _cell); },
_terminal.screen().scrollOffset());
if (cellAtMouse.hyperlink())
@@ -170,7 +170,7 @@ uint64_t Renderer::render(Terminal& _terminal,
else
{
changes = _terminal.preRender(_now);
- _terminal.screen().render(bind(&Renderer::renderCell, this, _1, _2, _3),
+ _terminal.screen().render([this](cursor_pos_t _row, cursor_pos_t _col, Cell const& _cell) { renderCell(_row, _col, _cell); },
_terminal.screen().scrollOffset());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment