While testing, using history in command buffer for some often repeated 
lyx-functions
is often made difficult when the previous (but not now desired) command
was repeated.

Objections?

        Kornel
diff --git a/src/Session.cpp b/src/Session.cpp
index a814991e59..5595aedf8e 100644
--- a/src/Session.cpp
+++ b/src/Session.cpp
@@ -406,10 +406,15 @@ void LastCommandsSection::setNumberOfLastCommands(unsigned int no)
 }
 
 
 void LastCommandsSection::add(std::string const & command)
 {
+	for (int i = (int) lastcommands.size() - 1; i >=0; --i) {
+		if (lastcommands[i].compare(command) == 0) {
+			lastcommands.erase(lastcommands.begin()+i);
+		}
+	}
 	lastcommands.push_back(command);
 }
 
 
 void LastCommandsSection::clear()

Attachment: pgpxTznOEUPqe.pgp
Description: Digitale Signatur von OpenPGP

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to