Created
November 7, 2014 12:01
-
-
Save anaselli/74755cc5a438330c2603 to your computer and use it in GitHub Desktop.
Patch to workaround ncurses problem on RichText link management
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iff --git a/src/NCRichText.cc b/src/NCRichText.cc | |
index ca1ded0..ba82fd5 100644 | |
--- a/src/NCRichText.cc | |
+++ b/src/NCRichText.cc | |
@@ -276,7 +276,8 @@ NCursesEvent NCRichText::wHandleInput( wint_t key ) | |
std::string str; | |
NCstring::RecodeFromWchar( anchors[armed].target, "UTF-8", &str ); | |
yuiMilestone() << "LINK: " << str << std::endl; | |
- ret.selection = new YMenuItem( str ); | |
+ ret.result = str; | |
+ ret.selection = NULL; | |
} | |
break; | |
diff --git a/src/NCtoY2Event.cc b/src/NCtoY2Event.cc | |
index d8a5af5..edc8558 100644 | |
--- a/src/NCtoY2Event.cc | |
+++ b/src/NCtoY2Event.cc | |
@@ -64,8 +64,12 @@ NCtoY2Event::propagate() | |
return 0; | |
case menu: | |
- if ( selection && widget && widget->isValid() ) | |
- return new YMenuEvent( selection ); | |
+ if ( widget && widget->isValid() ) { | |
+ if (selection) | |
+ return new YMenuEvent( selection ); | |
+ else | |
+ return new YMenuEvent( result ); | |
+ } | |
else | |
return 0; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment