Skip to content

Instantly share code, notes, and snippets.

@anaselli
Created November 7, 2014 12:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anaselli/74755cc5a438330c2603 to your computer and use it in GitHub Desktop.
Save anaselli/74755cc5a438330c2603 to your computer and use it in GitHub Desktop.
Patch to workaround ncurses problem on RichText link management
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