-
-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow naming of the tabs #1705
base: master
Are you sure you want to change the base?
Allow naming of the tabs #1705
Conversation
src/vtbackend/StatusLineBuilder.cpp
Outdated
@@ -156,6 +157,7 @@ std::optional<StatusLineDefinitions::Item> makeStatusLineItem( | |||
styles, | |||
activeColor, | |||
activeBackground, | |||
std::nullopt, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use designated initializers here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add a comment, that this is separator, because this class has an inheritance and we can not use designated initialization here :(
6caa4ba
to
e0b350e
Compare
e0b350e
to
9469f71
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you
"{SearchPrompt:Left= │ }" | ||
"{TraceMode:Bold,Color=#FFFF00,Left= │ }" | ||
"{ProtectedMode:Bold,Left= │ }" }; | ||
std::string middle { "{Title:Left= « ,Right= » }" }; | ||
std::string middle { "{Tabs: ActiveColor=#FFFF00}" }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's figure out what this space is used for here :)
std::string const& Terminal::windowTitle() const noexcept | ||
{ | ||
return _windowTitle; | ||
} | ||
|
||
void Terminal::setTabName() | ||
{ | ||
inputHandler().setTabName([&](std::string name) { _tabName = name; }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inputHandler().setTabName([&](std::string name) { _tabName = name; }); | |
inputHandler().setTabName([&](std::string name) { _tabName = std::move(name); }); |
@@ -54,7 +53,10 @@ class TerminalSessionManager: public QAbstractListModel | |||
display::TerminalDisplay* display = nullptr; | |||
TerminalSession* getSession() { return _sessions[0]; } | |||
|
|||
void Update() { updateStatusLine(); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
void Update() { updateStatusLine(); } | |
void update() { updateStatusLine(); } |
@@ -1562,11 +1562,26 @@ void Terminal::setWindowTitle(string_view title) | |||
_eventListener.setWindowTitle(title); | |||
} | |||
|
|||
void Terminal::setTabName(string_view title) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not used. either remove, or at least accept title as std::string
and then move ;it into _tabName
:)
void setGuiTabInfoForStatusLine(TabsInfo&& info) { _guiTabInfoForStatusLine = std::move(info); } | ||
|
||
TabsNamingMode getTabsNamingMode() const noexcept { return _settings.tabNamingMode; } | ||
void setTabName(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we maybe figure out a better name of it? Because setTabName
sounds like you're setting a tab name, and you're usually also passing the name.
@@ -444,25 +457,26 @@ void ViInputHandler::startSearchExternally() | |||
|
|||
Handled ViInputHandler::handleSearchEditor(char32_t ch, Modifiers modifiers) | |||
{ | |||
assert(_searchEditMode != SearchEditMode::Disabled); | |||
assert(_searchEditMode != PromptMode::Disabled); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's see if we can find a way to not duplicate the input handling by "dependency injection", implementing the custom behavior through some common interface (search vs tab naming vs future-feature)
void setSearchModeSwitch(bool enabled); | ||
void clearSearch(); | ||
|
||
private: | ||
std::optional<std::function<void(std::string)>> _setTabNameCallback { std::nullopt }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's move member variable declarations together (below)
Refs #1690
PR Adds naming to the tabs, and adds another option to the Tabs status line config, separator