It is "a matter of time" until Scotland becomes an independent country, crime writer and Yes supporter Val McDermid has declared.

The author said many of those who voted No during last year's independence referendum were "feeling pretty profoundly betrayed" by events following the historic ballot.

Ms McDermid made the comments during a session with First Minister Nicola Sturgeon at the Edinburgh International Book Festival, drawing heckles from a few audience members.

Ms Sturgeon, a self-confessed "fan girl" of crime fiction, was asking the author about her writing, including her latest novel Splinter the Silence at the sold out event.

It did not take long before the subject of the referendum was raised.

The politician said she had been struck by references to the September 2014 vote in Ms McDermid's book The Skeleton Road, written in the run-up to the ballot.

"All the characters who mention it mention it because they are undecided," Ms Sturgeon said.

"When you were writing it were you still undecided on the question of independence?"

Ms McDermid replied: "I was actually, when I was writing the book I was still swithering.

"I was undecided for quite a long time, and I think a lot of people were undecided and made their minds up during the course of the campaign."

Asked by Ms Sturgeon what made up her mind, Ms McDermid said: "I thought about it long and hard and it seemed to me that on so many of the key questions, one side said one thing, the other side said another, and there was no way of establishing which of those was the accurate position, and which was going to be the case.

"So I did what I thought was the sensible thing, and I looked at the record of the Scottish Parliament since it had been installed... and I set that against what Westminster had done in the corresponding period, and I decided that what we had done with the powers we had been given was much more in tune with my view of the world than what had happened at Westminster. So that was on the point on which I made my decision.

"It seemed to be self-evident at that point that we were better at managing our affairs than Westminster was at managing them for us."

Ms Sturgeon described the author's declaration of support for independence as "one of her favourite moments" in the campaign.

She went on to ask if Ms McDermid still believes Scotland will eventually leave the United Kingdom.

Ms McDermid said: "I think so. I think it is a matter of time. I think an awful lot of people who voted No are feeling pretty profoundly betrayed at this point."

The comment drew heckles from the audience, with some shouting out "no we're not", and others countering with "yes we are".

"Some of you are," Ms McDermid responded.

During the question and answer session with the audience, the writer was also asked, "as an expert in dangerous people," what was her view of Ms Sturgeon, who was dubbed "the most dangerous woman in Britain" during the general election campaign.

"I think that I am not alone in this country in thinking that Nicola is very impressive, but appears to have no homicidal tendencies," she quipped.

"If you ever wanted to write a novel about crime in politics, I could give you a list of villains... and potential victims," Ms Sturgeon added.