Skip to content

Commit

Permalink
Fix cursor-undo command (SpartanJ/ecode#389).
Browse files Browse the repository at this point in the history
  • Loading branch information
SpartanJ committed Feb 16, 2025
1 parent 2ed1774 commit 187b9bd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/eepp/network/http.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,9 @@ class EE_API Http : NonCopyable {
void setHost( const std::string& host, unsigned short port = 0, bool useSSL = false,
URI proxy = URI() );

/** @brief Sets the host from an URI (this is the equivalent of calling setHost( uri.getHost(), uri.getPort(), uri.getScheme() == "https" ) ) */
void setHost( const URI& uri, URI proxy = URI() );

/** @brief Send a HTTP request and return the server's response.
** You must have a valid host before sending a request (see setHost).
** Any missing mandatory header field in the request will be added
Expand Down
4 changes: 4 additions & 0 deletions src/eepp/network/http.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,10 @@ void Http::setHost( const std::string& host, unsigned short port, bool useSSL, U
}
}

void Http::setHost( const URI& uri, URI proxy ) {
setHost( uri.getHost(), uri.getPort(), uri.getScheme() == "https" );
}

Http::Response Http::sendRequest( const Http::Request& request, Time timeout ) {
IOStreamString stream;
Response response = downloadRequest( request, stream, timeout );
Expand Down
2 changes: 2 additions & 0 deletions src/eepp/ui/doc/textdocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3042,6 +3042,8 @@ TextPosition TextDocument::replaceSelection( const size_t& cursorIdx, const Stri
}

void TextDocument::cursorUndo() {
if ( mSelection.size() <= 1 )
return;
mSelection.erase( mSelection.begin() + mLastSelection );
mLastSelection = mSelection.size() - 1;
notifySelectionChanged();
Expand Down

0 comments on commit 187b9bd

Please sign in to comment.